Bug #41996
closedL10n fallback does not work anymore in BE
100%
Description
When choosing a Backend language that is incompletely translated, the fallback mechanism introduced with TYPO3 4.6 is not respected anymore, instead of falling back to the next available language, it falls back to English.
Tested on TYPO3 4.6 with language de_AT (self-defined without any special fallback meaning it should fall back first to 'de' and then to 'default' - English).
Files
Updated by Xavier Perseguers about 12 years ago
This patch seems the bug:
diff --git a/typo3/sysext/lang/lang.php b/typo3/sysext/lang/lang.php index fa24065..f761244 100755 --- a/typo3/sysext/lang/lang.php +++ b/typo3/sysext/lang/lang.php @@ -536,7 +536,7 @@ class language { */ protected function readLLfile($fileRef) { if ($this->lang !== 'default') { - $languages = array_reverse($this->languageDependencies); + $languages = $this->languageDependencies; } else { $languages = array('default'); }
Have to test it in multiple conditions (including Frontend rendering) because I suspect side-effects.
Updated by Xavier Perseguers about 12 years ago
- Status changed from New to Accepted
Updated by Xavier Perseguers about 12 years ago
How to reproduce¶
- Install an extension that only provide ll-XML translation files and provides a Backend module, e.g., TemplaVoilà
- Be sure to download translation for German
- Add this to your
localconf.php
:
$TYPO3_CONF_VARS['SYS']['localization']['locales']['user']['de_AT'] = 'Austrian German';
- Change your Backend language to Austrian German
=> You see module "Web > Page" instead of "Web > Seite" (Fallback to German expected)
- To further test the patch (from Gerrit), you may install an extension that does not provide a German translation either, e.g., "typo3mind" which provides a Backend module but only English as language. Expected is thus to get the English text (and not an empty label).
Updated by Xavier Perseguers about 12 years ago
Problem is in fact that t3lib_div::readLLfile() populates 'target' with English (= 'source') if reading a non-XLIFF file (that is a ll-XML). When reading an XLIFF file and no translation exists, an empty array is returned instead of a fall back to English and the fall back is then properly performed outside of the readLLfile() method.
As such the suggested first-attempt patch is wrong, reversing the order of language dependencies is correct and the bug is in ll-XML handling.
Updated by Gerrit Code Review about 12 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15634
Updated by Gerrit Code Review about 12 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15634
Updated by Gerrit Code Review about 12 years ago
Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/15709
Updated by Gerrit Code Review about 12 years ago
Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/15710
Updated by Xavier Perseguers about 12 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Updated by Anonymous almost 12 years ago
It seems, the Translation is broken after this bugfix
If you choose german as backend-language, and you have some Plugins without a german translation, it will return a blank text (no fallback to english)