diff options
author | kondou <kondou@ts.unde.re> | 2013-05-01 00:34:13 +0200 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2013-05-01 00:34:13 +0200 |
commit | d8e6db560877fc16d3eb0a825c94faa34179fb3a (patch) | |
tree | 05755456d4d8d603c9260676823a483156d48266 /settings/personal.php | |
parent | 4ab3614248df4834aa6e1a684760e89c641d4818 (diff) | |
download | nextcloud-server-d8e6db560877fc16d3eb0a825c94faa34179fb3a.tar.gz nextcloud-server-d8e6db560877fc16d3eb0a825c94faa34179fb3a.zip |
Sort priorized languages as defined in the array
Also add russian and arabic to the common languages.
Diffstat (limited to 'settings/personal.php')
-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; } |