#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 <span data-processor="relativetime" data-value="2026-09-17T21:55:45+00:00" > 09/17/26, 21:55 </span> -
Gerrit Code Review pushed patch set 2 for main to change 95906 <span data-processor="relativetime" data-value="2026-09-30T20:37:52+00:00" > 09/30/26, 20:37 </span>
-
Gerrit Code Review pushed patch set 1 for 14.3 to change 96253 <span data-processor="relativetime" data-value="2026-10-01T08:21:36+00:00" > 10/01/26, 08:21 </span>
-
Georg Ringer commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-01T08:25:11+00:00" > 10/01/26, 08:25 </span> -
Gerrit Code Review pushed patch set 2 for 14.3 to change 96253 status
ResolvedUnder Review <span data-processor="relativetime" data-value="2026-10-01T08:40:00+00:00" > 10/01/26, 08:40 </span> -
Georg Ringer commented and changed status
Under ReviewResolved <span data-processor="relativetime" data-value="2026-10-01T08:55:11+00:00" > 10/01/26, 08:55 </span>Applied in changeset commit:0fab1de1d436e16cfea87dd4aac25d3dee30f023.
Applied in changeset commit:a668a482f4a86fb45c5664db780dd40eac01741e.