diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-05-03 05:56:56 -0700 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-05-03 05:56:56 -0700 |
commit | cc3f7ba7e13886daa19a3f183f27ba250bbb53c7 (patch) | |
tree | 2e60999f79890a7036aa3695ad543bb6b1532ad8 /settings | |
parent | dcbbca1f894071839efcd30347e5e7c6689d707a (diff) | |
parent | d8e6db560877fc16d3eb0a825c94faa34179fb3a (diff) | |
download | nextcloud-server-cc3f7ba7e13886daa19a3f183f27ba250bbb53c7.tar.gz nextcloud-server-cc3f7ba7e13886daa19a3f183f27ba250bbb53c7.zip |
Merge pull request #3201 from owncloud/own_sorting_for_priorized_languages
Sort priorized languages as defined in the array
Diffstat (limited to 'settings')
-rw-r--r-- | settings/personal.php | 7 |
1 files changed, 4 insertions, 3 deletions
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; } |