Commit ddd1c98e authored by damjan's avatar damjan

[BUGFIX] Adding default language field in configuration.

Solves problem with TYPO3 having default language which is not english, and english is default language in all localization files.
parent 57ca794d
......@@ -83,6 +83,7 @@ class AddConstantController extends AbstractBackendController {
if (empty($nameOfConstant)) {
throw new LFException('failure.select.noConstDefined');
}
$extConfig = $this->configurationService->getExtConfig();
$this->configurationService->initFileObject(
$this->session->getDataByKey('languageFileSelection'),
......@@ -91,7 +92,9 @@ class AddConstantController extends AbstractBackendController {
$langData = $this->configurationService->getFileObj()->getLocalLangData();
if (!empty($langData['default'][$nameOfConstant])) {
$constExists = !empty($langData['en'][$nameOfConstant])
|| !empty($langData[$extConfig['defaultLanguage']][$nameOfConstant]);
if ($constExists) {
throw new LFException('failure.langfile.constExists');
}
......
......@@ -99,8 +99,7 @@ class DeleteConstantController extends AbstractBackendController {
public function deleteConstantSaveAction() {
try {
$constantSelection = $this->session->getDataByKey('constantSelection');
$languages = Functions::buildLangArray();
$langArray = array_merge(array('default'), $languages);
$langArray = Functions::buildLangArray();
// build modArray
$newLang = array();
......
......@@ -140,6 +140,7 @@ class EditConstantController extends AbstractBackendController {
$this->view->assign('constantSelection', $constantSelection);
$this->view->assign('languages', $languages);
$this->view->assign('numTextAreaRows', $extConfig['numTextAreaRows']);
$this->view->assign('defaultLanguage', $extConfig['defaultLanguage']);
}
/**
......
......@@ -107,7 +107,7 @@ class EditFileController extends AbstractBackendController {
* Structure of the content:
* $constValues[$constant]['edit'],
* $constValues[$constant]['pattern'],
* $constValues[$constant]['default'].
* $constValues[$constant][$extConfig['defaultLanguage']].
*
* @param array $langData
* @param integer $buttonType :
......@@ -130,7 +130,8 @@ class EditFileController extends AbstractBackendController {
$langEdit = is_array($langData[$langList]) ? $langData[$langList] : array();
$langPattern = is_array($langData[$patternList]) ? $langData[$patternList] : array();
$langDefault = is_array($langData['default']) ? $langData['default'] : array();
$langDefault = is_array($langData[$extConfig['defaultLanguage']])
? $langData[$extConfig['defaultLanguage']] : array();
$langDataSessionContinued = $buttonType != 3;
if ($buttonType === 0) {
......@@ -211,7 +212,7 @@ class EditFileController extends AbstractBackendController {
// save information about the constant
$constValues[$constant]['edit'] = preg_replace('/<br.*>/U', "\n", $editLangVal);
$constValues[$constant]['pattern'] = preg_replace('/<br.*>/U', "\n", $editPatternVal);
$constValues[$constant]['default'] = $langDefault[$constant];
$constValues[$constant][$extConfig['defaultLanguage']] = $langDefault[$constant];
} while (++$sessionLangDataConstantsIterator % $numConstantsPerPage);
$this->session->setDataByKey('langfileEditNewLangData', $langfileEditNewLangData);
......@@ -219,6 +220,7 @@ class EditFileController extends AbstractBackendController {
$this->session->setDataByKey('numberLastPageConstants', $numberLastPageConstants);
$this->view->assign('numTextAreaRows', $extConfig['numTextAreaRows']);
$this->view->assign('defaultLanguage', $extConfig['defaultLanguage']);
$this->view->assign('parallelEdit', $parallelEdit);
$this->view->assign('displayBackButton', $sessionLangDataConstantsIterator > $numConstantsPerPage);
$this->view->assign('displayNextButton', $sessionLangDataConstantsIterator < $numConsts);
......
......@@ -69,7 +69,7 @@ class GeneralController extends AbstractBackendController {
if (!$this->session->getDataByKey('languageFileSelection')) {
throw new LFException('failure.select.noLangfile', 1);
}
$this->prepareGeneralViewMainSectionContent('default');
$this->prepareGeneralViewMainSectionContent();
} catch (LFException $e) {
$this->addLFEFlashMessage($e);
}
......@@ -105,6 +105,7 @@ class GeneralController extends AbstractBackendController {
public function generalSaveAction(
$authorName = NULL, $authorEmail = NULL, $metaDescription = NULL, $transformFile = NULL, $splitFile = NULL
) {
// TODO: if XLF, dont merge!
try {
$metaArray = array(
'authorName' => $authorName,
......@@ -163,21 +164,21 @@ class GeneralController extends AbstractBackendController {
/**
* Prepares main section content of general view.
*
* @param string $referenceLanguageSelection
* @return void
*/
protected function prepareGeneralViewMainSectionContent($referenceLanguageSelection) {
protected function prepareGeneralViewMainSectionContent() {
$this->configurationService->initFileObject(
$this->session->getDataByKey('languageFileSelection'),
$this->session->getDataByKey('extensionSelection')
);
$extConfig = $this->configurationService->getExtConfig();
$referenceLanguageSelection = $extConfig['defaultLanguage'];
$langArray = $this->configurationService->getLangArray($this->backendUser);
$infoArray = Functions::genGeneralInfoArray(
$referenceLanguageSelection,
$langArray, $this->configurationService->getFileObj()
);
$description = $infoArray['default']['meta']['description'];
$description = $infoArray['en']['meta']['description'];
$description = preg_replace('/<br.*>/U', "\n", $description);
$langFileExtension = $this->configurationService->getFileObj()->getVar('fileType');
$preselectMerge = $this->isOriginSameForAllLanguages($infoArray);
......@@ -231,7 +232,7 @@ class GeneralController extends AbstractBackendController {
*/
private function isOriginSameForAllLanguages(array $infoArray) {
foreach ($infoArray as $langInfo) {
if ($infoArray['default']['origin'] !== $langInfo['origin']) {
if ($infoArray['en']['origin'] !== $langInfo['origin']) {
return FALSE;
}
}
......
......@@ -92,6 +92,7 @@ class RenameConstantController extends AbstractBackendController {
public function renameConstantSaveAction($newConstantName) {
try {
$oldConstantName = $this->session->getDataByKey('constantSelection');
$extConfig = $this->configurationService->getExtConfig();
if ($oldConstantName === $newConstantName) {
throw new LFException('failure.langfile.noChange');
......@@ -103,11 +104,13 @@ class RenameConstantController extends AbstractBackendController {
);
$langData = $this->configurationService->getFileObj()->getLocalLangData();
if (!empty($langData['default'][$newConstantName])) {
$constExists = !empty($langData['en'][$newConstantName])
|| !empty($langData[$extConfig['defaultLanguage']][$newConstantName]);
if ($constExists) {
throw new LFException('failure.langfile.constExists');
}
$langArray = array_merge(array('default'), Functions::buildLangArray());
$langArray = Functions::buildLangArray();
$newLang = array();
foreach ($langArray as $lang) {
if (isset($langData[$lang][$oldConstantName])) {
......
......@@ -143,6 +143,17 @@ class ConfigurationService extends AbstractService {
}
}
}
if (empty($this->extConfig['defaultLanguage'])) {
$this->extConfig['defaultLanguage'] = 'en';
} else {
/** @var Locales $locales */
$locales = GeneralUtility::makeInstance('TYPO3\CMS\Core\Localization\Locales');
$availableLanguages = $locales->getLanguages();
if (!isset($availableLanguages[$this->extConfig['defaultLanguage']])) {
$this->extConfig['defaultLanguage'] = 'en';
}
}
return $this->extConfig;
}
......@@ -271,7 +282,7 @@ class ConfigurationService extends AbstractService {
if (empty($this->langArray)) {
$languages = Functions::buildLangArray($this->extConfig['viewLanguages']);
$languages = $this->narrowToUserLanguages($languages, $backendUser);
$this->langArray = array_merge(array('default'), $languages);
$this->langArray = array_merge(array($this->extConfig['defaultLanguage']), $languages);
}
$langList = array();
foreach ($this->langArray as $lang) {
......@@ -394,7 +405,7 @@ class ConfigurationService extends AbstractService {
}
if (!$this->session->getDataByKey('defaultLanguagePermission')) {
unset($modArray['default']);
unset($modArray[$this->extConfig['defaultLanguage']]);
}
// set new language data
foreach ($modArray as $langKey => $data) {
......@@ -455,7 +466,7 @@ class ConfigurationService extends AbstractService {
// rewrite originLang array
$delLangFiles = array();
foreach ($langModes as $langKey => $mode) {
if ($langKey == 'default') {
if ($langKey == 'en') {
continue;
}
......@@ -645,8 +656,8 @@ class ConfigurationService extends AbstractService {
if (empty($this->langArray)) {
$languages = Functions::buildLangArray($this->extConfig['viewLanguages']);
$languages = $this->narrowToUserLanguages($languages, $backendUser);
if (!in_array('default', $languages)) {
$languages = array_merge(array('default'), $languages);
if (!in_array($this->extConfig['defaultLanguage'], $languages)) {
$languages = array_merge(array($this->extConfig['defaultLanguage']), $languages);
}
$this->langArray = $languages;
}
......
......@@ -392,7 +392,7 @@ class FileBackupService extends FileService {
// convert all values back to their original charsets
if (!Typo3Lib::isTypo3BackendInUtf8Mode()) {
$this->localLang = Typo3Lib::utf8($localLang, FALSE, array('default'));
$this->localLang = Typo3Lib::utf8($localLang, FALSE, array('en'));
} else {
$this->localLang = $localLang;
}
......@@ -409,7 +409,7 @@ class FileBackupService extends FileService {
private function prepareBackupContent() {
// convert all values to utf-8
if (!Typo3Lib::isTypo3BackendInUtf8Mode()) {
$localLang = Typo3Lib::utf8($this->localLang, TRUE, array('default'));
$localLang = Typo3Lib::utf8($this->localLang, TRUE, array('en'));
} else {
$localLang = $this->localLang;
}
......
......@@ -61,7 +61,7 @@ class FileBasePHPService extends FileBaseService {
// convert all language values from the original charset to utf-8
if (!Typo3Lib::isTypo3BackendInUtf8Mode()) {
$this->localLang = Typo3Lib::utf8($this->localLang, TRUE, array('default'));
$this->localLang = Typo3Lib::utf8($this->localLang, TRUE, array('en'));
}
}
......@@ -86,7 +86,7 @@ class FileBasePHPService extends FileBaseService {
}
/** @var array $LFMETA */
if ($langKey == 'default') {
if ($langKey == 'en') {
$this->meta = $LFMETA;
}
......@@ -232,7 +232,7 @@ class FileBasePHPService extends FileBaseService {
protected function prepareFileContents() {
// convert all language values from utf-8 to the original charset
if (!Typo3Lib::isTypo3BackendInUtf8Mode()) {
$this->localLang = Typo3Lib::utf8($this->localLang, FALSE, array('default'));
$this->localLang = Typo3Lib::utf8($this->localLang, FALSE, array('en'));
}
// prepare Content
......
......@@ -97,14 +97,14 @@ abstract class FileBaseService extends FileService {
*/
public function readFile() {
// read absolute file
$localLang = $this->readLLFile($this->absFile, 'default');
$localLang = $this->readLLFile($this->absFile, 'en');
// loop all languages
$languages = SgLib::getSystemLanguages();
$originLang = array();
foreach ($languages as $lang) {
$originLang[$lang] = $this->absFile;
if ((is_array($localLang[$lang]) && count($localLang[$lang])) || $lang === 'default') {
if ((is_array($localLang[$lang]) && count($localLang[$lang])) || $lang === 'en') {
if (is_array($localLang[$lang]) && count($localLang[$lang])) {
ksort($localLang[$lang]);
}
......
......@@ -60,7 +60,7 @@ class FileBaseXLFService extends FileBaseService {
// convert all language values from utf-8 to the original charset
if (!Typo3Lib::isTypo3BackendInUtf8Mode()) {
$this->localLang = Typo3Lib::utf8($this->localLang, FALSE, array('default'));
$this->localLang = Typo3Lib::utf8($this->localLang, FALSE, ['en']);
}
}
......@@ -84,11 +84,12 @@ class FileBaseXLFService extends FileBaseService {
// check data
if ((!is_array($xmlContent['file']['body']) || !count($xmlContent['file']['body']))
&& get_class($this) !== 'SGalinski\Lfeditor\Service\FileOverrideService'
// TODO: dont throw exception if main lang file has no constants and en is not default lang (&& 'en' === defaultLang)
) {
throw new LFException('failure.search.noFileContent', 0, '(' . $file . ')');
}
if ($langKey === 'default') {
if ($langKey === 'en') {
$this->meta = $xmlContent['file']['header'];
}
$this->meta['@attributes'] = $xmlContent['file']['@attributes'];
......@@ -104,10 +105,10 @@ class FileBaseXLFService extends FileBaseService {
* @return array
*/
public function resolveTranslationUnitsArrayIntoFlatArray(array $sourceData) {
$flatData = array();
$flatData = [];
if (isset($sourceData['trans-unit']['@attributes'])) {
$sourceData['trans-unit'] = array($sourceData['trans-unit']);
$sourceData['trans-unit'] = [$sourceData['trans-unit']];
}
foreach ((array) $sourceData['trans-unit'] as $data) {
......@@ -130,15 +131,15 @@ class FileBaseXLFService extends FileBaseService {
*/
public function readXlfFile() {
// read absolute file
$localLang['default'] = $this->readLLFile($this->absFile, 'default');
$localLang['default'] = $this->resolveTranslationUnitsArrayIntoFlatArray($localLang['default']);
$localLang['en'] = $this->readLLFile($this->absFile, 'en');
$localLang['en'] = $this->resolveTranslationUnitsArrayIntoFlatArray($localLang['en']);
// loop all languages
$originLang = array();
$originLang = [];
$languages = SgLib::getSystemLanguages();
foreach ($languages as $lang) {
$originLang[$lang] = $this->absFile;
if ($lang === 'default') {
if ($lang === 'en') {
continue;
}
......@@ -146,7 +147,7 @@ class FileBaseXLFService extends FileBaseService {
$lFile = $this->getLocalizedFile($localLang[$lang], $lang);
if ($this->checkLocalizedFile(basename($lFile), $lang)) {
$originLang[$lang] = $lFile;
$localLang[$lang] = array();
$localLang[$lang] = [];
if (!is_file($lFile)) {
continue;
......@@ -225,12 +226,12 @@ class FileBaseXLFService extends FileBaseService {
*
* @param array $phpArray
* @param string $targetLanguage
* @param array $defaultLanguage
* @param array $enLanguage
* @return string xml content
*/
private function array2xml($phpArray, $targetLanguage, $defaultLanguage) {
private function array2xml($phpArray, $targetLanguage, $enLanguage) {
$targetLanguage = htmlspecialchars($targetLanguage);
$targetLanguageAttribute = ($targetLanguage !== 'default' ? ' target-language="' . $targetLanguage . '"' : '');
$targetLanguageAttribute = ($targetLanguage !== 'en' ? ' target-language="' . $targetLanguage . '"' : '');
$lfeditorExtConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['lfeditor']);
$date = ($lfeditorExtConf['changeXlfDate'] ? gmdate('Y-m-d\TH:i:s\Z') : $this->meta['@attributes']['date']);
......@@ -257,15 +258,15 @@ class FileBaseXLFService extends FileBaseService {
if (is_array($phpArray['data']) && count($phpArray['data'])) {
$body = '<body>' . "\n";
foreach ($phpArray['data'] as $constant => $value) {
$approved = ($targetLanguage !== 'default' ? ' approved="yes"' : '');
$approved = ($targetLanguage !== 'en' ? ' approved="yes"' : '');
$body .= "\t\t" . '<trans-unit id="' . htmlspecialchars(
$constant
) . '"' . $approved . ' xml:space="preserve">' . "\n";
$defaultValue = SgLib::htmlSpecialCharsIgnoringCdata($defaultLanguage[$constant]);
$enValue = SgLib::htmlSpecialCharsIgnoringCdata($enLanguage[$constant]);
$value = SgLib::htmlSpecialCharsIgnoringCdata($value);
if ($targetLanguage !== 'default') {
$body .= "\t\t\t" . '<source>' . $defaultValue . '</source>' . "\n";
if ($targetLanguage !== 'en') {
$body .= "\t\t\t" . '<source>' . $enValue . '</source>' . "\n";
$body .= "\t\t\t" . '<target>' . $value . '</target>' . "\n";
} else {
$body .= "\t\t\t" . '<source>' . $value . '</source>' . "\n";
......@@ -286,7 +287,7 @@ class FileBaseXLFService extends FileBaseService {
* @return array new xml array
*/
private function getLangContent($localLang) {
$content = array();
$content = [];
if (!is_array($localLang) || !count($localLang)) {
return $content;
}
......@@ -326,26 +327,26 @@ class FileBaseXLFService extends FileBaseService {
protected function prepareFileContents() {
// convert all language values to utf-8
if (!Typo3Lib::isTypo3BackendInUtf8Mode()) {
$this->localLang = Typo3Lib::utf8($this->localLang, TRUE, array('default'));
$this->localLang = Typo3Lib::utf8($this->localLang, TRUE, ['en']);
}
// prepare Content
$metaData = $this->prepareMeta();
$languages = SgLib::getSystemLanguages();
$languageFiles = array();
$defaultLanguage = $this->getLangContent($this->localLang['default']);
$languageFiles = [];
$enLanguage = $this->getLangContent($this->localLang['en']);
foreach ($languages as $lang) {
if ($lang === 'default') {
if ($lang === 'en') {
continue;
}
if (is_array($this->localLang[$lang]) && count($this->localLang[$lang])) {
$file = $this->originLang[$lang];
$data = array(
$data = [
'header' => $metaData,
'data' => $this->getLangContent($this->localLang[$lang]),
);
$languageFiles[$file] .= $this->array2xml($data, $lang, $defaultLanguage);
];
$languageFiles[$file] .= $this->array2xml($data, $lang, $enLanguage);
}
}
......@@ -355,11 +356,11 @@ class FileBaseXLFService extends FileBaseService {
}
// prepare content for the main file
$data = array(
$data = [
'header' => $metaData,
'data' => $defaultLanguage,
);
$languageFiles[$this->absFile] = $this->array2xml($data, 'default', $defaultLanguage);
'data' => $enLanguage,
];
$languageFiles[$this->absFile] = $this->array2xml($data, 'en', $enLanguage);
return $languageFiles;
}
......
......@@ -65,7 +65,7 @@ class FileBaseXMLService extends FileBaseService {
// convert all language values from utf-8 to the original charset
if (!Typo3Lib::isTypo3BackendInUtf8Mode()) {
$this->localLang = Typo3Lib::utf8($this->localLang, FALSE, array('default'));
$this->localLang = Typo3Lib::utf8($this->localLang, FALSE, array('en'));
}
}
......@@ -91,7 +91,7 @@ class FileBaseXMLService extends FileBaseService {
}
// set header data
if ($langKey == 'default') {
if ($langKey == 'en') {
$this->meta = $xmlContent['meta'];
}
......@@ -282,7 +282,7 @@ class FileBaseXMLService extends FileBaseService {
protected function prepareFileContents() {
// convert all language values to utf-8
if (!Typo3Lib::isTypo3BackendInUtf8Mode()) {
$this->localLang = Typo3Lib::utf8($this->localLang, TRUE, array('default'));
$this->localLang = Typo3Lib::utf8($this->localLang, TRUE, array('en'));
}
// prepare Content
......
......@@ -80,7 +80,7 @@ class FileOverrideService extends FileBaseXMLService {
if (is_file($this->absFile)) {
parent::readFile();
if (!Typo3Lib::isTypo3BackendInUtf8Mode()) {
$this->localLang = Typo3Lib::utf8($this->localLang, FALSE, array('default'));
$this->localLang = Typo3Lib::utf8($this->localLang, FALSE, array('en'));
}
}
......
......@@ -197,7 +197,7 @@ abstract class FileService extends AbstractService {
* @return void
*/
public function setLocalLangData($constant, $value, $langKey, $forceDel = FALSE) {
if (!empty($value) || (($langKey === 'default' && !$forceDel))) {
if (!empty($value) || (($langKey === 'en' && !$forceDel))) {
$this->localLang[$langKey][$constant] = $value;
} elseif (isset($this->localLang[$langKey][$constant])) {
unset($this->localLang[$langKey][$constant]);
......
......@@ -241,7 +241,7 @@ class Functions {
foreach ($languages as $langKey) {
// get origin data and meta information
$origin = $fileObj->getOriginLangData($langKey);
$infos['default']['meta'] = $fileObj->getMetaData();
$infos['en']['meta'] = $fileObj->getMetaData();
// language data
$localLangData = $fileObj->getLocalLangData($langKey);
......
......@@ -245,7 +245,12 @@ class SgLib {
} else {
$availableLanguages = explode('|', TYPO3_languages);
}
foreach ($availableLanguages as $index => $lang) {
if ($lang === 'default') {
$availableLanguages[$index] = 'en';
break;
}
}
return $availableLanguages;
}
......
......@@ -23,22 +23,11 @@
<f:for each="{languages}" as="lang" iteration="iterator">
<fieldset class="tx-lfeditor-fieldset bgColor5 {f:if(condition: iterator.isEven, then: 'tx-lfeditor-fright')}{f:if(condition: iterator.isOdd, then: 'tx-lfeditor-fleft')}">
<legend class="bgColor3">{lang}</legend>
<f:if condition="{lang} == 'default'">
<f:then>
<f:form.textarea
cols="80" rows="{numTextAreaRows}"
name="addConstTextArea[{lang}]"
lang="en"
class="tx-lfeditor-textarea" />
</f:then>
<f:else>
<f:form.textarea
cols="80" rows="{numTextAreaRows}"
name="addConstTextArea[{lang}]"
lang="{lang}"
class="tx-lfeditor-textarea" />
</f:else>
</f:if>
<f:form.textarea
cols="80" rows="{numTextAreaRows}"
name="addConstTextArea[{lang}]"
lang="{lang}"
class="tx-lfeditor-textarea" />
</fieldset>
</f:for>
......
......@@ -18,16 +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>
<f:if condition="{lang} == 'default'">
<f:if condition="{lang} == {defaultLanguage}">
<f:then>
<legend class="bgColor3">default</legend>
<f:if condition="{defaultLanguagePermission}">
<f:then>
<f:form.textarea
cols="80" rows="{numTextAreaRows}"
value="{constValue}"
name="editConstTextArea[{lang}][{constantSelection}]"
lang="en"
lang="{lang}"
class="tx-lfeditor-textarea" />
</f:then>
<f:else>
......@@ -35,13 +35,14 @@
cols="80" rows="{numTextAreaRows}"
value="{constValue}"
name="editConstTextArea[{lang}][{constantSelection}]"
lang="en"
lang="{lang}"
additionalAttributes="{readonly: ''}"
class="tx-lfeditor-textarea" />
</f:else>
</f:if>
</f:then>
<f:else>
<legend class="bgColor3">{lang}</legend>
<f:form.textarea
cols="80" rows="{numTextAreaRows}"
value="{constValue}"
......
......@@ -44,16 +44,16 @@
<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">{languageSelection}:{constKey}</legend>
<f:if condition="{languageSelection} == 'default'">
<f:if condition="{languageSelection} == {defaultLanguage}">
<f:then>
<legend class="bgColor3">default:{constKey}</legend>
<f:if condition="{defaultLanguagePermission}">
<f:then>
<f:form.textarea
cols="80" rows="{numTextAreaRows}"
value="{constValue.edit}"
name="editFileTextArea[{languageSelection}][{constKey}]"
lang="en"
lang="{languageSelection}"
class="tx-lfeditor-textarea" />
</f:then>
<f:else>
......@@ -61,13 +61,14 @@
cols="80" rows="{numTextAreaRows}"
value="{constValue.edit}"
name="editFileTextArea[{languageSelection}][{constKey}]"
lang="en"
lang="{languageSelection}"
additionalAttributes="{readonly: ''}"
class="tx-lfeditor-textarea" />
</f:else>
</f:if>
</f:then>
<f:else>
<legend class="bgColor3">{languageSelection}:{constKey}</legend>
<f:form.textarea
cols="80" rows="{numTextAreaRows}"
value="{constValue.edit}"
......@@ -84,16 +85,16 @@
</fieldset>
<f:if condition="{parallelEdit}">
<fieldset class="tx-lfeditor-fieldset bgColor5 tx-lfeditor-fright">
<legend class="bgColor3">{referenceLanguageSelection}:{constKey}</legend>
<f:if condition="{referenceLanguageSelection} == 'default'">
<f:if condition="{referenceLanguageSelection} == {defaultLanguage}">
<f:then>
<legend class="bgColor3">default:{constKey}</legend>
<f:if condition="{defaultLanguagePermission}">
<f:then>
<f:form.textarea
cols="80" rows="{numTextAreaRows}"
value="{constValue.pattern}"
name="editFileTextArea[{referenceLanguageSelection}][{constKey}]"
lang="en"
lang="{referenceLanguageSelection}"
class="tx-lfeditor-textarea" />
</f:then>
<f:else>
......@@ -101,13 +102,14 @@
cols="80" rows="{numTextAreaRows}"
value="{constValue.pattern}"
name="editFileTextArea[{referenceLanguageSelection}][{constKey}]"
lang="en"
lang="{referenceLanguageSelection}"
additionalAttributes="{readonly: ''}"
class="tx-lfeditor-textarea" />
</f:else>
</f:if>
</f:then>
<f:else>
<legend class="bgColor3">{referenceLanguageSelection}:{constKey}</legend>
<f:form.textarea
cols="80" rows="{numTextAreaRows}"
value="{constValue.pattern}"
......
......@@ -85,13 +85,13 @@
<label for="name" class="tx-lfeditor-label">
<f:translate key="function.general.metaInfo.author.name" />
</label>
<f:form.textfield id="name" name="authorName" value="{infos.default.meta.authorName}" class="tx-lfeditor-input" />
<f:form.textfield id="name" name="authorName" value="{infos.en.meta.authorName}" class="tx-lfeditor-input" />
</div>
<div>
<label for="email" class="tx-lfeditor-label">
<f:translate key="function.general.metaInfo.author.email" />
</label>
<f:form.textfield id="email" name="authorEmail" value="{infos.default.meta.authorEmail}" class="tx-lfeditor-input" />
<f:form.textfield id="email" name="authorEmail" value="{infos.en.meta.authorEmail}" class="tx-lfeditor-input" />
</div>
</fieldset>
<fieldset class="bgColor4">
......
......@@ -3,6 +3,9 @@
# cat=basic; type=string; label=View languages: List of languages which will be available in the extension (comma separated short names e.g. da, de, fi). If field is empty all languages will be used (Warning: very long list!). Default language is always included.
viewLanguages =
# cat=basic; type=string; label=Default language: If 'en' is not default language in TYPO3 BE, default language must be defined here (e.g. de).
defaultLanguage =
# cat=basic; type=string; label=Ignore extensions: Regular expression which limits the extension key list.
extIgnore = /^(CVS|.svn|.git|csh_)/
......
Markdown is supported
0% or