From f0bcd169a8ccf7ff83e02b6d3a93200343e40ca9 Mon Sep 17 00:00:00 2001 From: Oleksandr Matsko Date: Fri, 26 Jan 2024 16:32:45 +0100 Subject: [PATCH] [TASK] Add default translation for requested language if it not exists --- Classes/Localization/CsvLocalizationParser.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Classes/Localization/CsvLocalizationParser.php b/Classes/Localization/CsvLocalizationParser.php index 9cd0572..8b06e6a 100644 --- a/Classes/Localization/CsvLocalizationParser.php +++ b/Classes/Localization/CsvLocalizationParser.php @@ -44,6 +44,11 @@ public function getParsedData($sourcePath, $languageKey): array } } + // Add default translation for requested language if it not exists + if (!array_key_exists($languageKey, $LOCAL_LANG)) { + $LOCAL_LANG[$languageKey] = $LOCAL_LANG['default']; + } + fclose($handle); unset($LOCAL_LANG['identifier']); unset($LOCAL_LANG['description']);