Commit 6f9ae903 authored by damjan's avatar damjan

[BUGFIX] Using 'en' as language label instead of 'default'

parent a7c68e15
......@@ -284,24 +284,28 @@ class ConfigurationService extends AbstractService {
$langData, $default = '', BackendUserAuthentication $backendUser = NULL, $translatedLanguagesOnly = FALSE) {
// build languages
$languageArray = $this->getLangArray($backendUser);
$langList = array();
foreach ($languageArray as $lang) {
$languageList = array();
foreach ($languageArray as $language) {
$constCount = 0;
if (is_array($langData[$lang])) {
$constCount = count($langData[$lang]);
if (is_array($langData[$language])) {
$constCount = count($langData[$language]);
}
if ($translatedLanguagesOnly && $constCount <= 0) {
continue;
}
$langList[$lang] = $lang . ' (' . $constCount . ' ' .
$languageLabel = $language;
if ($language == 'default') {
$languageLabel = 'en';
}
$languageList[$language] = $languageLabel . ' (' . $constCount . ' ' .
LocalizationUtility::translate('const.consts', 'lfeditor') . ')';
}
// add default value
if (!empty($default)) {
$langList = array_merge(array('###default###' => $default), $langList);
$languageList = array_merge(array('###default###' => $default), $languageList);
}
return $langList;
return $languageList;
}
/**
......
......@@ -18,14 +18,16 @@
<f:form id="contentForm" action="editConstantSave">
<f:for each="{languages}" key="lang" as="constValue" iteration="iterator">
<fieldset class="tx-lfeditor-fieldset bgColor5 {f:if(condition: iterator.isEven, then: 'tx-lfeditor-fright', else: 'tx-lfeditor-fleft')}">
<legend class="bgColor3">{lang}</legend>
<legend class="bgColor3">
{f:if(condition: '{lang} == \'default\'', then: 'en', else: '{lang}')}
</legend>
<lfe:extendedIf condition="{lang} == {defaultLanguage}" and="{defaultLanguagePermission} != 'TRUE'">
<f:then>
<f:form.textarea
cols="80" rows="{numTextAreaRows}"
value="{constValue}"
name="editConstTextArea[{lang}][{constantSelection}]"
lang="{lang}"
lang="{f:if(condition: '{lang} == \'default\'', then: 'en', else: '{lang}')}"
additionalAttributes="{readonly: ''}"
class="tx-lfeditor-textarea" />
</f:then>
......@@ -34,7 +36,7 @@
cols="80" rows="{numTextAreaRows}"
value="{constValue}"
name="editConstTextArea[{lang}][{constantSelection}]"
lang="{lang}"
lang="{f:if(condition: '{lang} == \'default\'', then: 'en', else: '{lang}')}"
class="tx-lfeditor-textarea" />
</f:else>
</lfe:extendedIf>
......
......@@ -46,7 +46,7 @@
<f:for each="{constValues}" key="constKey" as="constValue" iteration="iterator">
<fieldset class="tx-lfeditor-fieldset bgColor5 {lfe:extendedIf(condition: iterator.isOdd, or: parallelEdit, then: 'tx-lfeditor-fleft', else: 'tx-lfeditor-fright')}">
<legend class="bgColor3 tx-lfeditor-constantMaxWidth400" title="{languageSelection}:{constKey}">
{languageSelection}:{constKey}
{f:if(condition: '{languageSelection} == \'default\'', then: 'en', else: '{languageSelection}')}:{constKey}
</legend>
<lfe:extendedIf condition="{languageSelection} == {defaultLanguage}" and="{defaultLanguagePermission} != 'TRUE'">
<f:then>
......@@ -54,7 +54,7 @@
cols="80" rows="{numTextAreaRows}"
value="{constValue.edit}"
name="editFileTextArea[{languageSelection}][{constKey}]"
lang="{languageSelection}"
lang="{f:if(condition: '{languageSelection} == \'default\'', then: 'en', else: '{languageSelection}')}"
additionalAttributes="{readonly: ''}"
class="tx-lfeditor-textarea" />
</f:then>
......@@ -63,7 +63,7 @@
cols="80" rows="{numTextAreaRows}"
value="{constValue.edit}"
name="editFileTextArea[{languageSelection}][{constKey}]"
lang="{languageSelection}"
lang="{f:if(condition: '{languageSelection} == \'default\'', then: 'en', else: '{languageSelection}')}"
class="tx-lfeditor-textarea" />
</f:else>
</lfe:extendedIf>
......@@ -76,7 +76,7 @@
<f:if condition="{parallelEdit}">
<fieldset class="tx-lfeditor-fieldset bgColor5 tx-lfeditor-fright">
<legend class="bgColor3 tx-lfeditor-constantMaxWidth400" title="{referenceLanguageSelection}:{constKey}">
{referenceLanguageSelection}:{constKey}
{f:if(condition: '{referenceLanguageSelection} == \'default\'', then: 'en', else: '{referenceLanguageSelection}')}:{constKey}
</legend>
<lfe:extendedIf condition="{referenceLanguageSelection} == {defaultLanguage}" and="{defaultLanguagePermission} != 'TRUE'">
<f:then>
......@@ -84,7 +84,7 @@
cols="80" rows="{numTextAreaRows}"
value="{constValue.pattern}"
name="editFileTextArea[{referenceLanguageSelection}][{constKey}]"
lang="{referenceLanguageSelection}"
lang="{f:if(condition: '{referenceLanguageSelection} == \'default\'', then: 'en', else: '{referenceLanguageSelection}')}"
additionalAttributes="{readonly: ''}"
class="tx-lfeditor-textarea" />
</f:then>
......@@ -93,7 +93,7 @@
cols="80" rows="{numTextAreaRows}"
value="{constValue.pattern}"
name="editFileTextArea[{referenceLanguageSelection}][{constKey}]"
lang="{referenceLanguageSelection}"
lang="{f:if(condition: '{referenceLanguageSelection} == \'default\'', then: 'en', else: '{referenceLanguageSelection}')}"
class="tx-lfeditor-textarea" />
</f:else>
</lfe:extendedIf>
......
......@@ -35,7 +35,7 @@
<tr>
<td class="bgColor4">
<f:link.action action="goToEditFile" arguments="{language: langKey}">
{langKey}
{f:if(condition: '{langKey} == \'default\'', then: 'en', else: '{langKey}')}
</f:link.action>
</td>
<td class="bgColor4">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment