Do not use the language name, when it's not the one from the language we want

This commit is contained in:
Joas Schilling 2016-06-01 17:07:51 +02:00
parent 7b4459d28d
commit 1b5797a4e5
No known key found for this signature in database
GPG Key ID: 70A0B324C41C0946
1 changed files with 3 additions and 2 deletions

View 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