[BUGIFX] Translations action only returning default language

This commit is contained in:
Philipp Dieter 2026-03-12 17:22:28 +01:00
parent b2f9fa6846
commit 0e77b7a75a

View File

@ -46,18 +46,18 @@ class TranslationController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionCont
} else {
$language = $GLOBALS['TYPO3_REQUEST']->getAttribute('language');
}
$locale = $language->getLocale();
//\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump(
// $locale, '$locale', 3, true, false
//);
$language = $language->getTypo3language();
$langfileContent = $languageFactory->getParsedData(
$langfilePath,
$locale
$language
);
$langfileResult = [];
foreach (reset($langfileContent) as $key => $row) {
$langfileResult[$key] = reset($row)['target'];
}
foreach ($langfileContent[$language] as $key => $row) {
$langfileResult[$key] = reset($row)['target'];
}
$result[$extension] = $langfileResult;
}
$GLOBALS['TSFE']->setContentType('application/json');