Commit d6c104d0 authored by damjan's avatar damjan

[BUGFIX] Not using abbreviations.

parent aee321c6
......@@ -115,22 +115,22 @@ class ConfigurationService extends AbstractService {
$langs = GeneralUtility::trimExplode(',', $this->extConfig['viewLanguages'], TRUE);
unset($this->extConfig['viewLanguages']);
$availableLanguages = array();
$availableLanguageKeys = array();
if (GeneralUtility::compat_version('6.0')) {
/** @var Locales $locales */
$locales = GeneralUtility::makeInstance('TYPO3\CMS\Core\Localization\Locales');
$availableLanguages = $locales->getLanguages();
$availableLanguageKeys = $locales->getLanguages();
} else {
$languages = explode(
'|', TYPO3_languages
);
foreach ($languages as $language) {
$availableLanguages[$language] = TRUE;
$availableLanguageKeys[$language] = TRUE;
}
}
foreach ($langs as $lang) {
if (!isset($availableLanguages[$lang])) {
if (!isset($availableLanguageKeys[$lang])) {
if ($this->invalidLanguages === '') {
$this->invalidLanguages = $lang;
} else {
......@@ -149,8 +149,8 @@ class ConfigurationService extends AbstractService {
} else {
/** @var Locales $locales */
$locales = GeneralUtility::makeInstance('TYPO3\CMS\Core\Localization\Locales');
$availableLanguages = $locales->getLanguages();
if (!isset($availableLanguages[$this->extConfig['defaultLanguage']])) {
$availableLanguageKeys = $locales->getLanguages();
if (!isset($availableLanguageKeys[$this->extConfig['defaultLanguage']])) {
$this->extConfig['defaultLanguage'] = 'en';
}
}
......
......@@ -241,17 +241,17 @@ class SgLib {
/** @var $locales Locales */
$locales = GeneralUtility::makeInstance('TYPO3\CMS\Core\Localization\Locales');
$locales->initialize();
$availableLanguages = $locales->getLocales();
$availableLanguageKeys = $locales->getLocales();
} else {
$availableLanguages = explode('|', TYPO3_languages);
$availableLanguageKeys = explode('|', TYPO3_languages);
}
foreach ($availableLanguages as $index => $lang) {
if ($lang === 'default') {
$availableLanguages[$index] = 'en';
foreach ($availableLanguageKeys as $index => $language) {
if ($language === 'default') {
$availableLanguageKeys[$index] = 'en';
break;
}
}
return $availableLanguages;
return $availableLanguageKeys;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment