diff options
author | Thomas Citharel <tcit@tcit.fr> | 2017-07-13 10:34:27 +0200 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2018-06-27 13:19:23 +0200 |
commit | abab7eb7f071282a4a3fa839dcc6f61ac4632f6b (patch) | |
tree | 6f217feea2391c44cd959b6087e3ff0a697dc5ec /lib/private/L10N | |
parent | 4a9f8623b50ab0ba6a7fd411c0750a6bd5f63c14 (diff) | |
download | nextcloud-server-abab7eb7f071282a4a3fa839dcc6f61ac4632f6b.tar.gz nextcloud-server-abab7eb7f071282a4a3fa839dcc6f61ac4632f6b.zip |
handle config.php values
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'lib/private/L10N')
-rw-r--r-- | lib/private/L10N/Factory.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/private/L10N/Factory.php b/lib/private/L10N/Factory.php index a6b91d53e4f..86f2ab3b1f0 100644 --- a/lib/private/L10N/Factory.php +++ b/lib/private/L10N/Factory.php @@ -111,6 +111,11 @@ class Factory implements IFactory { $lang = $forceLang; } + $forceLocale = $this->config->getSystemValue('force_locale', false); + if (is_string($forceLocale)) { + $locale = $forceLocale; + } + if ($lang === null || !$this->languageExists($app, $lang)) { $lang = $this->findLanguage($app); } @@ -207,17 +212,17 @@ class Factory implements IFactory { return $userLocale; } - // If no user locale set, use lang as locale - if (null !== $lang && $this->localeExists($lang)) { - return $lang; - } - // Default : use system default locale $defaultLocale = $this->config->getSystemValue('default_locale', false); if ($defaultLocale !== false && $this->localeExists($defaultLocale)) { return $defaultLocale; } + // If no user locale set, use lang as locale + if (null !== $lang && $this->localeExists($lang)) { + return $lang; + } + // At last, return USA return 'en_US'; } |