Commit e682716b authored by damjan's avatar damjan

[BUGFIX] EN is always added by default.

EN doesn't need to be specified in configuration as viewed language.
parent 3ac4b37b
......@@ -280,13 +280,9 @@ class ConfigurationService extends AbstractService {
*/
public function menuLangList($langData, $default = '', BackendUserAuthentication $backendUser = NULL) {
// build languages
if (empty($this->langArray)) {
$languages = Functions::buildLangArray($this->extConfig['viewLanguages']);
$languages = $this->narrowToUserLanguages($languages, $backendUser);
$this->langArray = array_merge(array($this->extConfig['defaultLanguage']), $languages);
}
$languageArray = $this->getLangArray($backendUser);
$langList = array();
foreach ($this->langArray as $lang) {
foreach ($languageArray as $lang) {
$constCount = 0;
if (is_array($langData[$lang])) {
$constCount = count($langData[$lang]);
......@@ -661,6 +657,10 @@ class ConfigurationService extends AbstractService {
if (empty($this->langArray)) {
$languages = Functions::buildLangArray($this->extConfig['viewLanguages']);
$languages = $this->narrowToUserLanguages($languages, $backendUser);
if (!in_array('en', $languages)) {
$languages = array_merge(array('en'), $languages);
}
if (!in_array($this->extConfig['defaultLanguage'], $languages)) {
$languages = array_merge(array($this->extConfig['defaultLanguage']), $languages);
}
......
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