Skip to content

Commit

Permalink
[BUGFIX] Fill alternative language keys correctly
Browse files Browse the repository at this point in the history
This change adds the language dependencies individually to the array
instead of completely overwriting them as a string. Since the
dependencies are iterated in the core, this function only adds to the
array instead of overwriting the first index.

Resolves: #88045
Releases: master, 9.5
Change-Id: I3101bf8f9873ffa5ceeee3cc9e9ace36858f39a4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61406
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
  • Loading branch information
georgringer authored and andreaskienast committed Aug 5, 2019
1 parent 62a78be commit 7d0ed02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php
Expand Up @@ -199,15 +199,15 @@ protected static function getLanguageKeys(): array
} elseif (isset($tsfe->config['config']['language'])) {
$languageKeys['languageKey'] = $tsfe->config['config']['language'];
if (isset($tsfe->config['config']['language_alt'])) {
$languageKeys['alternativeLanguageKeys'] = $tsfe->config['config']['language_alt'];
$languageKeys['alternativeLanguageKeys'][] = $tsfe->config['config']['language_alt'];
}
}

if (empty($languageKeys['alternativeLanguageKeys'])) {
$locales = GeneralUtility::makeInstance(Locales::class);
if (in_array($languageKeys['languageKey'], $locales->getLocales())) {
foreach ($locales->getLocaleDependencies($languageKeys['languageKey']) as $language) {
$languageKeys['alternativeLanguageKeys'] = $language;
$languageKeys['alternativeLanguageKeys'][] = $language;
}
}
}
Expand Down

0 comments on commit 7d0ed02

Please sign in to comment.