Bug #20219
closedLOCAL_LANG default values are overwritten by localized text
0%
Description
Consider the following XML (see XML-file attached):
<T3locallang>
<meta type="array">
<type>module</type>
<description>Language labels for testing purposes</description>
</meta>
<data type="array">
<languageKey index="default" type="array">
<label index="button1">Button 1 - Description (EN)</label>
<label index="button2">Button 2 - Description (EN)</label>
<label index="button3">Button 3 - Description (EN)</label>
</languageKey>
<languageKey index="fr" type="array">
<label index="button1">Button 1 - Description (FR)</label>
<label index="button2">Button 2 - Description (FR)</label>
</languageKey>
</data>
</T3locallang>
When tring to get the french Label for Button 3, you expect to receive "Button 3 - Description (EN)", since there is no french localized label for Button 3.
Instead you get "Button 2 - Description (FR)".
The last default value, is always replaced by the last localized value (see Screenshot).
This is caused by the readLLXMLfile-function. The function iterates through the $LOCAL_LANG['default'] values by assigning by reference to $labelValue (line 4186).
Since $labelValue is not unset later, the reference will stay on the last value of $LOCAL_LANG['default']. Later then $labelValue is used again to iterate through $LOCAL_LANG[$langKey], and it then overwrites the last value in $LOCAL_LANG['default'] since the reference is still intact.
(issue imported from #M10742)
Files
Updated by Oliver Hader over 15 years ago
Sounds reasonable...
Did you post this as RFC to the core list as the accordant tag of this issue tells? I couldn't find it there...
Updated by Mathias Gisch over 15 years ago
No, I am just checking out the trunk. Will post it then ...
Updated by Oliver Hader over 15 years ago
Whatever... I'm going to take care of that RFC
Updated by Oliver Hader over 15 years ago
- TYPO3_4-2 (rev. 5212)
- Trunk (rev. 5213)