summaryrefslogtreecommitdiffstats
path: root/lib/private/TemplateLayout.php
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-09-10 10:19:49 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-09-10 10:42:08 +0200
commitdf143cb72a9681d977a7fa85553a95ce1ee2314f (patch)
treed40f7d7bc787393a049e92ecb56ec98339502010 /lib/private/TemplateLayout.php
parente9c644412c65aab4799c5dc24dcfa294cc7f5a23 (diff)
downloadnextcloud-server-df143cb72a9681d977a7fa85553a95ce1ee2314f.tar.gz
nextcloud-server-df143cb72a9681d977a7fa85553a95ce1ee2314f.zip
Use user locale as default in the template
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'lib/private/TemplateLayout.php')
-rw-r--r--lib/private/TemplateLayout.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php
index 0bd57c4139b..a710ee856e3 100644
--- a/lib/private/TemplateLayout.php
+++ b/lib/private/TemplateLayout.php
@@ -139,9 +139,12 @@ class TemplateLayout extends \OC_Template {
}
// Send the language and the locale to our layouts
$lang = \OC::$server->getL10NFactory()->findLanguage();
+ $locale = \OC::$server->getL10NFactory()->findLocale($lang);
+ $localeLang = \OC::$server->getL10NFactory()->findLanguageFromLocale('lib', $locale);
+
$lang = str_replace('_', '-', $lang);
$this->assign('language', $lang);
- $this->assign('locale', \OC::$server->getL10NFactory()->findLocale($lang));
+ $this->assign('locale', $locale);
if(\OC::$server->getSystemConfig()->getValue('installed', false)) {
if (empty(self::$versionHash)) {
@@ -159,7 +162,7 @@ class TemplateLayout extends \OC_Template {
if ($this->config->getSystemValue('installed', false) && $renderAs != 'error') {
if (\OC::$server->getContentSecurityPolicyNonceManager()->browserSupportsCspV3()) {
$jsConfigHelper = new JSConfigHelper(
- \OC::$server->getL10N('lib'),
+ \OC::$server->getL10N('lib', $localeLang),
\OC::$server->query(Defaults::class),
\OC::$server->getAppManager(),
\OC::$server->getSession(),