[TASK][!!!] Fix localization handling to support XLIFF
authorXavier Perseguers <typo3@perseguers.ch>
Tue, 14 Jun 2011 05:53:34 +0000 (07:53 +0200)
committerXavier Perseguers <typo3@perseguers.ch>
Tue, 14 Jun 2011 05:53:34 +0000 (07:53 +0200)
Due to change in localization handling within Core, Extbase
must be updated to get strings when retrieving labels.

Change-Id: I5a52da13887e1dbd59790425e2bd5139f224e93a
Resolves: #27411

typo3/sysext/extbase/Classes/Utility/Localization.php

index 277b4fa..c9a7aaf 100644 (file)
@@ -85,17 +85,17 @@ class Tx_Extbase_Utility_Localization {
                        self::initializeLocalization($extensionName);
                        // The "from" charset of csConv() is only set for strings from TypoScript via _LOCAL_LANG
                        if (isset(self::$LOCAL_LANG[$extensionName][self::$languageKey][$key])) {
-                               $value = self::$LOCAL_LANG[$extensionName][self::$languageKey][$key];
+                               $value = self::$LOCAL_LANG[$extensionName][self::$languageKey][$key][0]['target'];
                                if (isset(self::$LOCAL_LANG_charset[$extensionName][self::$languageKey][$key])) {
                                        $value = self::convertCharset($value, self::$LOCAL_LANG_charset[$extensionName][self::$languageKey][$key]);
                                }
                        } elseif (self::$alternativeLanguageKey !== '' && isset(self::$LOCAL_LANG[$extensionName][self::$alternativeLanguageKey][$key])) {
-                               $value = self::$LOCAL_LANG[$extensionName][self::$alternativeLanguageKey][$key];
+                               $value = self::$LOCAL_LANG[$extensionName][self::$alternativeLanguageKey][$key][0]['target'];
                                if (isset(self::$LOCAL_LANG_charset[$extensionName][self::$alternativeLanguageKey][$key])) {
                                        $value = self::convertCharset($value, self::$LOCAL_LANG_charset[$extensionName][self::$alternativeLanguageKey][$key]);
                                }
                        } elseif (isset(self::$LOCAL_LANG[$extensionName]['default'][$key])) {
-                               $value = self::$LOCAL_LANG[$extensionName]['default'][$key]; // No charset conversion because default is english and thereby ASCII
+                               $value = self::$LOCAL_LANG[$extensionName]['default'][$key][0]['target']; // No charset conversion because default is english and thereby ASCII
                        }
                }
                if (is_array($arguments)) {