Project

General

Profile

Actions

Bug #53973

closed

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

Added by Reinhard Führicht over 10 years ago. Updated over 6 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 #1

Updated by Gerrit Code Review over 10 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

Actions #2

Updated by Reinhard Führicht almost 10 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #3

Updated by Sven Burkert almost 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.

Actions #4

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF