Project

General

Profile

Actions

Bug #79348

closed

Localization in TyposcriptFrontendController only allows defined Backend-Languages in TYPO3\CMS\Core\Localization\Locales

Added by Tobias Eichelberger about 7 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Localization
Target version:
-
Start date:
2017-01-17
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Xlf
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hi there,

we need two additional languages for our projects:
- cn
- tw

We wondered, why it is not possible to get the linked xlf-files
- /MyExtension/Resources/Private/Language/cn.locallang.xlf
- /MyExtension/Resources/Private/Language/tw.locallang.xlf

working, and found the reason in TyposcriptFrontendController->initLLvars:

In this method, TYPO3 decides wether $this->languageDependencies is written or not:

  // Language is found. Configure it:
  if (in_array($this->lang, $locales->getLocales())) { // this fails, due to getLocales!
      $this->languageDependencies[] = $this->lang;

$locales->getLocales() comes from TYPO3\CMS\Core\Localization\Locales, in which you can read: "Defining backend system languages".

After that process TyposcriptFrontendController->readLLfile only loads locallang files, with a prefix from languageDependencies.

The problem now is:
If we need a language, which is not supported by TYPO3 backend/locales, we fail, even though it would be no problem to load and use the language with any other (wrong) prefix.

So my request/question is, to simply change the TyposcriptFrontendController->initLLvars as follows:

  // Language is found. Configure it:
  if (in_array($this->lang, $locales->getLocales()) || TYPO3_MODE === "FE") { //underline TYPO3_MODE == FE ;)
      $this->languageDependencies[] = $this->lang;

This would allow to use any iso2-language prefix in frontend.

Do you guys see any problems with that?

Best regards,
Duke

Actions #1

Updated by Susanne Moog about 6 years ago

  • Category set to Localization
Actions #2

Updated by Georg Ringer over 4 years ago

  • Tags set to Xlf
Actions #3

Updated by Marc Bastian Heinrichs over 4 years ago

Do you guys see any problems with that?

Jep, TYPO3_MODE or TYPO3_REQUESTTYPE (since v9) does not help here, because you can have a TyposcriptFrontendController "booted" also in an request started in BE or CLI.

Also you need support for country specific languages, like de_CH and fr_CH, where the languageDependencies de and fr will be missing for fallback.

Actions #4

Updated by Marc Bastian Heinrichs over 4 years ago

There is an configuration option
https://docs.typo3.org/m/typo3/reference-coreapi/master/en-us/ApiOverview/Internationalization/ManagingTranslations.html#custom-languages
to add custom languages, which could be used to solve both needs here.
You will see this languages in the language module in backend, but it does not really hurt IMO.

Actions #5

Updated by Benni Mack about 3 years ago

  • Status changed from New to Closed

Exactly as Marc Bastian pointed out:

In order to add custom languages (esp for XLF based label files), the global configuration options are necessary, which will then be working installation-wide.

Actions

Also available in: Atom PDF