Issue Bug Closed

#44626Numeric translation keys aren't translated right in XML files

Reinhard Führicht 01/18/13, 09:50 updated 10/23/17, 22:01

Description

When working with the “old” XML based translation files, numeric keys aren’t translated properly.

Example:

<languageKey index="default" type="array">
    <label index="1">1</label>
    <label index="2">2</label>
    <label index="3">3</label>

    <label index="11">11</label>
    <label index="22">22</label>
    <label index="33">33</label>
</languageKey>

Output:

2
3
11

33

I investigated this issue and found out that “LocallangXmlParser” in typo3/sysext/core/Classes/Localization/Parser uses array_merge to combine the translation arrays of the default language and the current language.

Problem

array_merge renumbers numeric keys. Therefore, numeric key in translation files result in wrong translations in Frontend.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.