From abab7eb7f071282a4a3fa839dcc6f61ac4632f6b Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 13 Jul 2017 10:34:27 +0200 Subject: handle config.php values Signed-off-by: Georg Ehrke --- lib/private/L10N/Factory.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'lib/private/L10N/Factory.php') 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'; } -- cgit v1.2.3