Project

General

Profile

Actions

Bug #41996

closed

L10n fallback does not work anymore in BE

Added by Xavier Perseguers about 12 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Category:
Localization
Target version:
-
Start date:
2012-10-14
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.6
PHP Version:
5.3
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

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


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #44099: L10n fallback does not work for TS labelsClosedXavier Perseguers2012-12-18

Actions
Related to TYPO3 Core - Bug #44273: L10n fallback does not work for ExtJS in BEClosedXavier Perseguers2013-01-02

Actions
Actions #1

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.

Actions #2

Updated by Xavier Perseguers about 12 years ago

  • Status changed from New to Accepted
Actions #3

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).
Actions #4

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.

Actions #5

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

Actions #6

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

Actions #7

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

Actions #8

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

Actions #9

Updated by Xavier Perseguers about 12 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #10

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)

Actions #11

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF