Compare commits

..

1 Commits

Author SHA1 Message Date
Philipp Dieter
0e77b7a75a [BUGIFX] Translations action only returning default language 2026-03-12 17:22:28 +01:00

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');