Project

General

Profile

Actions

Bug #102579

closed

typo3Language Site Configuration set to a full locale instead of language key

Added by Garvin Hicking 12 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Start date:
2023-12-01
Due date:
% Done:

100%

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

Description

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.3/Deprecation-99882-SiteLanguageTypo3LanguageSetting.html introduced a autodetection method for the "typo3Language" option.

The autodetection uses:

        $typo3Language = $this->locale->getLanguageCode();
        if ($this->locale->getCountryCode()) {
            $typo3Language .= '_' . $this->locale->getCountryCode();
        }

Appending the Country Code to a string like "de" or "en" will lead to a language key like "de_DE", which then searches for files called `de_DE.locallang.xlf` - but the files are (usually? always?) called `de.locallang.xlf`.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #100759: f:translate does not take overrides of labels in TypoScript into account anymoreClosed2023-04-26

Actions
Actions #1

Updated by Garvin Hicking 12 months ago

  • Related to Bug #100759: f:translate does not take overrides of labels in TypoScript into account anymore added
Actions #2

Updated by Gerrit Code Review 12 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82061

Actions #3

Updated by Garvin Hicking 12 months ago

Looking further into it it seems that maybe multiple file name resolvings need to work?

typo3Language: de_DE
files: de_DE.locallang.xlf -> or if missing: de-DE.locallang.xlf -> or if missing: de.locallang.xlf?

typo3Language: de
files: de.locallang.xlf

This is a deep dive through many init(...) and languageService factory plus instantiation layers.

Shortcircuiting `SiteLanguage.php::getTypoe3Language()` to this:

    public function getTypo3Language(): string
    {
        if ($this->typo3Language !== '') {
            return $this->typo3Language;
        }
        // locale is just set to "C" or "en", this should then be mapped to "default" 
        if ($this->locale->getLanguageCode() === 'en' && !$this->locale->getCountryCode()) {
            return 'default';
        }
        return $this->locale->getLanguageCode();
    }

works for my cases with "de.locallang.xlf" labels, but I'm sure this is not the way it was meant to be.

I tested this purely with a TYPO3 v13/main installation and the "fe-login" extension. No custom typoscript, extensions or anythin else. Downloading a german languagepack only creates "de.locallang.xlf" files, and not "de_DE.locallang.xlf" or "de-DE.locallang.xlf".

Actions #4

Updated by Gerrit Code Review 12 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82061

Actions #5

Updated by Gerrit Code Review 12 months ago

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82065

Actions #6

Updated by Gerrit Code Review 12 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82065

Actions #7

Updated by Gerrit Code Review 12 months ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82019

Actions #8

Updated by Benni Mack 12 months ago

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

Updated by Gerrit Code Review 12 months ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/82019

Actions #10

Updated by Benni Mack 12 months ago

  • Status changed from Under Review to Resolved
Actions #11

Updated by Benni Mack 4 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF