From d8e6db560877fc16d3eb0a825c94faa34179fb3a Mon Sep 17 00:00:00 2001 From: kondou Date: Wed, 1 May 2013 00:34:13 +0200 Subject: Sort priorized languages as defined in the array Also add russian and arabic to the common languages. --- settings/personal.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'settings/personal.php') diff --git a/settings/personal.php b/settings/personal.php index 57a7e4ee9cd..de029770d98 100644 --- a/settings/personal.php +++ b/settings/personal.php @@ -24,12 +24,13 @@ $languageCodes=OC_L10N::findAvailableLanguages(); // array of common languages $commonlangcodes = array( - 'en', 'es', 'fr', 'de', 'de_DE', 'ja_JP', 'nl', 'it', 'pt_BR', 'pt_PT', 'da', 'fi_FI', 'nb_NO', 'sv', 'zh_CN', 'ko' + 'en', 'es', 'fr', 'de', 'de_DE', 'ja_JP', 'ar', 'ru', 'nl', 'it', 'pt_BR', 'pt_PT', 'da', 'fi_FI', 'nb_NO', 'sv', 'zh_CN', 'ko' ); $languageNames=include 'languageCodes.php'; $languages=array(); -$commonlanguages = array(); +// Initialize array, so we can substitue later with our in $commonlangcodes specified order +$commonlanguages = array_fill(0, count($commonlangcodes), ""); foreach($languageCodes as $lang) { $l=OC_L10N::get('settings', $lang); if(substr($l->t('__language_name__'), 0, 1)!='_') {//first check if the language name is in the translation file @@ -45,7 +46,7 @@ foreach($languageCodes as $lang) { if ($lang === $userLang) { $userLang = $ln; } elseif (in_array($lang, $commonlangcodes)) { - $commonlanguages[]=$ln; + $commonlanguages[array_search($lang, $commonlangcodes)]=$ln; } else { $languages[]=$ln; } -- cgit v1.2.3