aboutsummaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-01-15 15:25:58 +0100
committerRobin Appelman <icewind@owncloud.com>2012-01-15 15:25:58 +0100
commit37c0b97b3c4c429b2bea73f4abf8f7179b1a00e8 (patch)
tree8dc33f59e9437b6699851ea322a129955234ba17 /settings
parent7cd809b286aee9d90e8a7d01f3a21e8e65978d28 (diff)
downloadnextcloud-server-37c0b97b3c4c429b2bea73f4abf8f7179b1a00e8.tar.gz
nextcloud-server-37c0b97b3c4c429b2bea73f4abf8f7179b1a00e8.zip
make language name translatable and fallback to language code if we dont have the language name
Diffstat (limited to 'settings')
-rwxr-xr-xsettings/personal.php10
1 files changed, 9 insertions, 1 deletions
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