[BUGFIX] Allow "en" as language key 14/17414/4
authorDaniel Alder <dalder@snowflake.ch>
Tue, 8 Jan 2013 10:21:25 +0000 (11:21 +0100)
committerXavier Perseguers <xavier@typo3.org>
Thu, 14 Feb 2013 14:15:20 +0000 (15:15 +0100)
Fix a bug which was introduced by #25397 (commit:cb390c79).
If the selected language key is "en", do not override it to "default".
This allows custom updates to translations even for the English language.

Change-Id: I3fcbd35f0144a0cc152acd45d0861d153cc8b495
Resolves: #42084
Related: #25397
Releases: 4.6, 4.7, 6.0, 6.1
Reviewed-on: https://review.typo3.org/17414
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/sysext/core/Classes/Localization/LocalizationFactory.php
typo3/sysext/core/Classes/Localization/Parser/AbstractXmlParser.php

index 40dc363..865d849 100644 (file)
@@ -88,8 +88,6 @@ class LocalizationFactory implements \TYPO3\CMS\Core\SingletonInterface {
                try {
                        $hash = md5($fileReference . $languageKey . $charset);
                        $this->errorMode = $errorMode;
-                       // English is the default language
-                       $languageKey = $languageKey === 'en' ? 'default' : $languageKey;
                        // Check if the default language is processed before processing other language
                        if (!$this->store->hasData($fileReference, 'default') && $languageKey !== 'default') {
                                $this->getParsedData($fileReference, 'default', $charset, $this->errorMode);
index 2550d27..d6a2f6d 100644 (file)
@@ -61,7 +61,7 @@ abstract class AbstractXmlParser implements \TYPO3\CMS\Core\Localization\Parser\
                $this->sourcePath = $sourcePath;
                $this->languageKey = $languageKey;
                $this->charset = $this->getCharset($languageKey, $charset);
-               if ($this->languageKey !== 'default' && $this->languageKey !== 'en') {
+               if ($this->languageKey !== 'default') {
                        $this->sourcePath = \TYPO3\CMS\Core\Utility\GeneralUtility::getFileAbsFileName(\TYPO3\CMS\Core\Utility\GeneralUtility::llXmlAutoFileName($this->sourcePath, $this->languageKey));
                        if (!@is_file($this->sourcePath)) {
                                // Global localization is not available, try split localization file