[TYPO3-english] Bug in locallangXMLOverride mechanism since TYPO3 4.6?
Lars Patrick Heß
larshess at gmail.com
Tue Dec 13 17:52:24 CET 2011
Hey all :-)
i am using the "locallangXMLOverride" in TYPO3 4.6 mechanism to override XML-languagefiles, i use the following line oh php code to configure the override in a localconf-file:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']['path/to/originalTranslationFile.xml'][] = 'path/to/otherTranslationFile.xml'
The content of the original translation file "originalTranslationFile.xml" is this:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<data type="array">
<languageKey index="default" type="array">
<label index="test_label_one">one (default)</label>
<label index="test_label_two">two (default)</label>
</languageKey>
<languageKey index="de" type="array">
<label index="test_label_one">eins (german)</label>
<label index="test_label_two">zwei (german)</label>
</languageKey>
</data>
</T3locallang>
The content of the translation file "otherTranslationFile.xml", which is used to override translations, is this:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3locallang>
<data type="array">
<languageKey index="fr" type="array">
<label index="test_label_one">une (française)</label>
</languageKey>
</data>
</T3locallang>
My testcase in typoscriot is something like this, it only outputs two translations via the TS-TEXT object:
config {
linkVars = L
sys_language_uid = 0
language = en
locale_all = en_EN.UTF-8
htmlTag_langKey = en
}
# DE
[globalVar=GP:L=1]
config {
sys_language_uid = 1
language = de
locale_all = de_DE.UTF-8
htmlTag_langKey = de
}
[global]
# FR
[globalVar = GP:L = 2]
config {
sys_language_uid = 2
language = fr
locale_all = fr_FR.UTF-8
htmlTag_langKey = fr
}
[global]
page = PAGE
page.typeNum = 0
page.10 = TEXT
page.10.data = LLL:path/to/originalTranslationFile.xml:test_label_one
page.10.wrap = | <br />
page.20 = TEXT
page.20.data = LLL:path/to/originalTranslationFile.xml:test_label_two
The output in english (the default language) is this:
une (française) // << that's wrong! It must be "one (default)"
two (default)
In german:
une (française) // << that's wrong! It must be "eins (german)"
zwei (german)
In french:
une (française)
two (default)
The error occured while processing the locallangXMLOverrides-files, while loading the language "default" from the translation file "otherTranslationFile.xml" (which does not contain any default-translations), the french-translations are rreturned! So the default translations from the "originalTranslationFile.xml" translation file will be overridden while the merging process!
When i replace the t3lib_div::readLLfile method with the code from TYPO3 4.5 (so that the new t3lib_l10n classes are not used) it works!
Does anyone knows the problem?
Thanks,
Lars
More information about the TYPO3-english
mailing list