Project

General

Profile

Actions

Bug #104468

open

Allow non-english languages as FE default language

Added by Hannes Lau 3 days ago. Updated 3 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Localization
Target version:
-
Start date:
2024-07-24
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.3
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

We have a lot of projects where the sites are created in German and later translated to English. This is true for the site content but also for the xlf labels. So our source locallang.xlf files are in German. Translation agencies create the translation files, such as en.locallang.xlf or zh.locallang.xlf. It is way easier for them to work forward from the locallang.xlf with the source tags, then backwards (target -> source) from a translated de.locallang.xlf.

Up to TYPO3 12, this worked fine. We just had to register English as another translation language in ext_localconf.php.

// As this site uses German as the default language, register English as a translation language
$GLOBALS['TYPO3_CONF_VARS']['SYS']['localization']['locales']['user'] = ['en' => 'English'];

Since TYPO3 12, probably since https://review.typo3.org/c/Packages/TYPO3.CMS/+/77558 this does not work any more.

https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Localization/LanguageService.php#L296 has been altered:

    private function getTypo3LanguageKey(): string
    {
        if ($this->locale === null) {
            return 'default';
        }
        if ($this->locale->getName() === 'en') {
            return 'default';
        }
        return $this->locale->getName();
    }

This forces our language 'en' back to 'default'. But default is German. When we remove those lines, it seems to work fine. Do we need them in the core?


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #104064: English is always taken as default xlf languageClosed2024-06-11

Actions
Actions

Also available in: Atom PDF