Project

General

Profile

Actions

Bug #100176

closed

Translations not available in v12.2 when using language key with country in site config

Added by Chris Müller about 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Must have
Assignee:
-
Category:
Localization
Target version:
Start date:
2023-03-15
Due date:
% Done:

100%

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

Description

In my site configuration the locale field of a language configuration is set to "de_DE.utf8". This results in a locale "de-DE" for translation.

This is now also used in LocalizationFactory when retrieving the translations via getParsedData() method.

As the translation file is named "de.locallang.xlf" but the mentioned method resolves the path to "de-DE.locallang.xlf" the translations falls back to the default language (English, what is not wanted on a German page).

When I change the locallang file to "de-DE.locallang.xlf" the translation works. But this is not what is wanted, especially when having multiple countries for the same language, like de-DE, de-AT, de-CH and just want to override some labels for a specific country.

I use <f:translate> view helper in a page template when the error occurred (non-Extbase context). Using the view helper in Extbase context seems to work.

Another observation: When logged-in into the backend and using the translate view helper out of Extbase in frontend, the getLanguageService() method of the view helper returns $GLOBALS['LANG'] early. Which means, the language is based on the language of the backend user, not the language of the frontend page.


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #98501: Cannot open uncached frontend with invoked f:translate view helperClosed2022-10-02

Actions
Related to TYPO3 Core - Bug #100030: Translation handling: Fallback chain is broken if backend user is logged in. ResolvedBenni Mack2023-02-24

Actions
Related to TYPO3 Core - Bug #100255: Language of backend user influence FE translationsResolved2023-03-22

Actions
Actions

Also available in: Atom PDF