]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not use the language name, when it's not the one from the language we want
authorJoas Schilling <nickvergessen@owncloud.com>
Wed, 1 Jun 2016 15:07:51 +0000 (17:07 +0200)
committerJoas Schilling <nickvergessen@owncloud.com>
Wed, 1 Jun 2016 15:07:51 +0000 (17:07 +0200)
settings/personal.php

index 3d294acaccf1db630bba07746b15fdd2734f9ab6..0b2781fb21b3bd65928ba4f2d5984bdc380f4aaa 100644 (file)
@@ -81,8 +81,9 @@ $commonLanguages = array();
 foreach($languageCodes as $lang) {
        $l = \OC::$server->getL10N('settings', $lang);
        // TRANSLATORS this is the language name for the language switcher in the personal settings and should be the localized version
-       if(substr($l->t('__language_name__'), 0, 1) !== '_') {//first check if the language name is in the translation file
-               $ln=array('code'=>$lang, 'name'=> (string)$l->t('__language_name__'));
+       $potentialName = (string) $l->t('__language_name__');
+       if($l->getLanguageCode() === $lang && substr($potentialName, 0, 1) !== '_') {//first check if the language name is in the translation file
+               $ln=array('code'=>$lang, 'name'=> $potentialName);
        }elseif(isset($languageNames[$lang])) {
                $ln=array('code'=>$lang, 'name'=>$languageNames[$lang]);
        }else{//fallback to language code