Review main Merged Breaking

15634[!!!][BUGFIX] Localization fallback does not work in Backend

Xavier Perseguers CR +2 V +2 Easy +9 −5 updated 06/03/13, 20:49

Commit message

The ll-XML parser internally falls-back to English when looking for a
non-existing language translation. This prevents the localization
fallback mechanism to detect that the translation did not exist or was
only partially available and thus take the language dependency into
account to return a proper label.

Review

  • Code review CR +2
    • Xavier Perseguers +2
    • Dominique Feyer +1
    • Steffen Ritter +1
  • Verified V +2
    • Xavier Perseguers +2
    • Dominique Feyer +1
    • Steffen Ritter +1

Files 2

Review log 11

  1. Xavier Perseguers commented on patch set 1 10/16/12, 12:02

    (2 inline comments) Added explanation for the patch. Please see the Forge entry for an how to reproduce procedure.

    LocallangXmlParser.php:83

    parsedData is an array that should have for each label key a subkey 'source' with English version and possibly 'target' with the translation. If we are populating the 'source' element, we want to parse the ll-XML file, that's obvious because English is always present but if we are currently preparing the default language, we want to have the 'target' element to the English text, thus we systematically parse the file and push all texts to parsedData

    LocallangXmlParser.php:86

    If we are currently reading the translated labels ($element === 'target') but not for the default language, then we want to start with an empty list of translated labels and only populate it with actually translated records. The original version populated parsedData with English labels and possibly overrided them with the real translation. But this provides a "translation" for labels in every case with a hard-coded fallback to English and we cannot then do a proper fall-back because 'target' is never empty, thus it seems that a translation always exists in the requested language.
  2. Xavier Perseguers commented on patch set 2 10/16/12, 12:02

    Adjusted unit tests
  3. Xavier Perseguers uploaded patch set 2 10/16/12, 12:02

  4. Steffen Ritter commented on patch set 1 10/16/12, 12:02

    Verified; Looks good to me, but someone else must approve
  5. Steffen Ritter commented on patch set 2 10/16/12, 12:02

    Verified; Looks good to me, but someone else must approve
  6. Mattias Nilsson commented on patch set 1 10/16/12, 12:02

    Looks good to me, but someone else must approve
  7. Dominique Feyer commented on patch set 2 10/16/12, 12:02

    Verified; Looks good to me, but someone else must approve Review yesterday evening ... but forget to click on the button. Event better with the unit test
  8. Mr. Jenkins commented on patch set 1 10/16/12, 12:02

  9. Mr. Jenkins commented on patch set 2 10/16/12, 12:02

  10. Xavier Perseguers commented on patch set 2 V 0 10/16/12, 12:02

    by team member; Looks good to me, approved
  11. Xavier Perseguers merged patch set 2 10/16/12, 12:02