#107799Possible Pagerenderer->addInlineLanguageLabelFile Bug
Description
I have a situation where I load a locallang_js.xlf using the pagerenderer->addInlineLanguageLabelFile function. My Site locale is da_DK so I have a da.locallang_js.xlf file for danish translations. In TYPO3.lang I only get the english labels. Only if I rename my file from da.locallang_js.xlf to da_DK.locallang_js.xlf does it work.
I did some debugging and can see that TypoScriptFrontendController get the language/locale from the incoming request. The Locale is created in vendor/typo3/cms-core/Classes/Site/Entity/SiteLanguage.php line 113 $this->locale = new Locale($locale); (no dependencies given so the Locale property dependencies is just an empty array).
If I use my locallang_js.xlf in a fluid f:translate situation the translation file da.locallang_js.xlf works just fine. In this context the Locale object is created in vendor/typo3/cms-core/Classes/Localization/Locales.php line 156: return new Locale($localeKey, $alternativeDependencies ?? $this->getLocaleDependencies($sanitizedLocaleKey ?? $localeKey)); (dependencies ‘da’ given to Locale constructor).
Is it correct to assume that f:translate and pagerenderer->addInlineLanguageLabelFile should behave the same way regarding translation files? Hopefully Im not missing something here.
Reviews 2
History 26
-
Gerrit Code Review pushed patch set 1 for main to change 95906 status
NewUnder Review 09/17/26, 21:55 -
Gerrit Code Review pushed patch set 2 for main to change 95906 09/30/26, 20:37
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 96253 10/01/26, 08:21
-
Georg Ringer commented and changed status
Under ReviewResolved done0 %100 % 10/01/26, 08:25 -
Gerrit Code Review pushed patch set 2 for 14.3 to change 96253 status
ResolvedUnder Review 10/01/26, 08:40 -
Georg Ringer commented and changed status
Under ReviewResolved 10/01/26, 08:55Applied in changeset commit:0fab1de1d436e16cfea87dd4aac25d3dee30f023.
Applied in changeset commit:a668a482f4a86fb45c5664db780dd40eac01741e.