Bug #102579
closedtypo3Language Site Configuration set to a full locale instead of language key
100%
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`.
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
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
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".
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
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
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
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
Updated by Benni Mack 12 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 68e8f0310802b4a7dee70bce693338a9d9fc36b4.
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
Updated by Benni Mack 12 months ago
- Status changed from Under Review to Resolved
Applied in changeset 5ebad2d456227384b1f9bc1126920f776c91c185.