From 0e77b7a75a56c76bf210125262e82ec8f5b13218 Mon Sep 17 00:00:00 2001 From: Philipp Dieter Date: Thu, 12 Mar 2026 17:22:28 +0100 Subject: [PATCH] [BUGIFX] Translations action only returning default language --- Classes/Controller/TranslationController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Classes/Controller/TranslationController.php b/Classes/Controller/TranslationController.php index c74537a..a7771b0 100644 --- a/Classes/Controller/TranslationController.php +++ b/Classes/Controller/TranslationController.php @@ -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');