summaryrefslogtreecommitdiffstats
path: root/settings/personal.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2016-06-01 17:07:51 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2016-06-01 17:07:51 +0200
commit1b5797a4e52f67e4d9ea0fe7e2c20bd14f94ade1 (patch)
treef7017b36b78dc0c75491cb88a777289e0289e2df /settings/personal.php
parent7b4459d28d40523c70ec05a733e158f2c14faac4 (diff)
downloadnextcloud-server-1b5797a4e52f67e4d9ea0fe7e2c20bd14f94ade1.tar.gz
nextcloud-server-1b5797a4e52f67e4d9ea0fe7e2c20bd14f94ade1.zip
Do not use the language name, when it's not the one from the language we want
Diffstat (limited to 'settings/personal.php')
-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