Actions
Bug #53973
closedCannot add user defined locales to be used with "sL(...)"
Start date:
2013-11-26
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
TYPO3 has a list of "known" languages set in TYPO3\CMS\Core\Localization\Locales.
To extend this list one can use something like this:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user']['id'] = 'Indonesian';
For reading the translation of a word in this language, one can use:
$GLOBALS['TSFE']->sL('LLL:path/to/lang/file/lang.xml:langkey');
Problem¶
The user defined locales are not taken into account.
In TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController (line 4675):
$locales = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Localization\\Locales'); // Language is found. Configure it: if (in_array($this->lang, $locales->getLocales())) { $this->languageDependencies[] = $this->lang; foreach ($locales->getLocaleDependencies($this->lang) as $language) { $this->languageDependencies[] = $language; } }
There is no call to $locales->initialize() which would read the user defined settings:
$locales = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Localization\\Locales'); $locales->initialize(); // Language is found. Configure it: if (in_array($this->lang, $locales->getLocales())) { $this->languageDependencies[] = $this->lang; foreach ($locales->getLocaleDependencies($this->lang) as $language) { $this->languageDependencies[] = $language; } }
Actions