From f184bda59b12a662a01e0474470a4cdf2992d989 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sat, 21 Nov 2020 14:20:01 +0100 Subject: [PATCH] Make sure locale is always set, even on first request --- classes/Factory/ViewFactory.php | 2 +- templates/inc/head.tpl | 2 +- templates/inc/header.tpl | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/Factory/ViewFactory.php b/classes/Factory/ViewFactory.php index b5d2b19..d7048b7 100644 --- a/classes/Factory/ViewFactory.php +++ b/classes/Factory/ViewFactory.php @@ -81,7 +81,7 @@ class ViewFactory $view->registerPlugin('block', 't', [$localeManager, 'smartyTranslate']); $view->offsetSet('canonical', self::getCanonicalUrl($request)); - $view->offsetSet('locale', $container->get('locale')->getLocale()); + $view->offsetSet('locale', $container->get('locale')); $view->offsetSet('config', $container->get('config')); $view->offsetSet('domain', $uri->withBasePath('')->getBaseUrl()); diff --git a/templates/inc/head.tpl b/templates/inc/head.tpl index eee7e43..d214316 100644 --- a/templates/inc/head.tpl +++ b/templates/inc/head.tpl @@ -1,5 +1,5 @@ - + diff --git a/templates/inc/header.tpl b/templates/inc/header.tpl index 3e8f233..af28104 100644 --- a/templates/inc/header.tpl +++ b/templates/inc/header.tpl @@ -2,8 +2,8 @@ {if isset($supportedLocales) AND count($supportedLocales) > 1}