Issue Bug Resolved

#107799Possible Pagerenderer->addInlineLanguageLabelFile Bug

Henrik Jensen 10/21/25, 10:54 updated 10/01/26, 08:55

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

  1. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-10-01T08:25:11+00:00" > 10/01/26, 08:25 </span>

    Applied in changeset commit:a668a482f4a86fb45c5664db780dd40eac01741e.

  2. Gerrit Code Review pushed patch set 2 for 14.3 to change 96253 status Resolved Under Review <span data-processor="relativetime" data-value="2026-10-01T08:40:00+00:00" > 10/01/26, 08:40 </span>

  3. Georg Ringer commented and changed status Under Review Resolved <span data-processor="relativetime" data-value="2026-10-01T08:55:11+00:00" > 10/01/26, 08:55 </span>

    Applied in changeset commit:0fab1de1d436e16cfea87dd4aac25d3dee30f023.