Bug #53973
closedCannot add user defined locales to be used with "sL(...)"
100%
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; } }
Updated by Gerrit Code Review almost 11 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25685
Updated by Reinhard Führicht over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 28c66c57fcefb9df9ffe0c0a4bb8f310243d7e9b.
Updated by Sven Burkert over 10 years ago
Will this bug getting fixed in TYPO3 CMS 6.1?
According to the revision 28c66c57 it will. But for now it's only fixed in 6.2.1, not in 6.1.8.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed