From: Robin Appelman Date: Sun, 15 Jan 2012 14:25:58 +0000 (+0100) Subject: make language name translatable and fallback to language code if we dont have the... X-Git-Tag: v3.0~40^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=37c0b97b3c4c429b2bea73f4abf8f7179b1a00e8;p=nextcloud-server.git make language name translatable and fallback to language code if we dont have the language name --- diff --git a/settings/personal.php b/settings/personal.php index 7035f1b07d4..8d05b14a353 100755 --- a/settings/personal.php +++ b/settings/personal.php @@ -28,10 +28,18 @@ $languageCodes=OC_L10N::findAvailableLanguages(); //put the current language in the front unset($languageCodes[array_search($lang,$languageCodes)]); array_unshift($languageCodes,$lang); + $languageNames=include 'languageCodes.php'; $languages=array(); foreach($languageCodes as $lang){ - $languages[]=array('code'=>$lang,'name'=>@$languageNames[$lang]); + $l=new OC_L10N('core',$lang); + if($l->t('__language_name__')!='__language_name__'){//first check if the language name is in the translation file + $languages[]=array('code'=>$lang,'name'=>$l->t('__language_name__')); + }elseif(isset($languageNames[$lang])){ + $languages[]=array('code'=>$lang,'name'=>$languageNames[$lang]); + }else{//fallback to language code + $languages[]=array('code'=>$lang,'name'=>$lang); + } } // Return template