summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-06-03 10:50:59 +0200
committerVincent Petry <pvince81@owncloud.com>2016-06-03 10:50:59 +0200
commit2d5bee0661d52629b1ca0b8ec3c57752a3b7d8ed (patch)
tree6d2988aac86cf6b13212bc54734326c529616e0d
parentf2064232ef4d5a07946ff72df4d01de1d85e0331 (diff)
parent1b5797a4e52f67e4d9ea0fe7e2c20bd14f94ade1 (diff)
downloadnextcloud-server-2d5bee0661d52629b1ca0b8ec3c57752a3b7d8ed.tar.gz
nextcloud-server-2d5bee0661d52629b1ca0b8ec3c57752a3b7d8ed.zip
Merge pull request #24954 from owncloud/issue-24536-language-name-reused-for-fallback-languages
Do not use the language name, when it's not the one from the languageā€¦
-rw-r--r--settings/personal.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/settings/personal.php b/settings/personal.php
index 3d294acaccf..0b2781fb21b 100644
--- a/settings/personal.php
+++ b/settings/personal.php
@@ -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