Project

General

Profile

Actions

Bug #53973

closed

Cannot add user defined locales to be used with "sL(...)"

Added by Reinhard Führicht almost 11 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
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;
    }
}

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #66872: Only output of default xml-labels in TYPO3 6.2.12Closed2015-05-10

Actions
Actions

Also available in: Atom PDF