Bug #41996
closed
L10n fallback does not work anymore in BE
Added by Xavier Perseguers about 12 years ago.
Updated about 6 years ago.
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
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.
- Status changed from New to Accepted
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).
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.
- Status changed from Accepted to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
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)
- Status changed from Resolved to Closed
Also available in: Atom
PDF