diff --git a/core/lib/Thelia/Config/Resources/config.xml b/core/lib/Thelia/Config/Resources/config.xml index 0cf616126..5574d07bc 100755 --- a/core/lib/Thelia/Config/Resources/config.xml +++ b/core/lib/Thelia/Config/Resources/config.xml @@ -211,7 +211,7 @@ - null + diff --git a/core/lib/Thelia/Core/Translation/Translator.php b/core/lib/Thelia/Core/Translation/Translator.php index 22dc47afd..444604e28 100755 --- a/core/lib/Thelia/Core/Translation/Translator.php +++ b/core/lib/Thelia/Core/Translation/Translator.php @@ -1,18 +1,28 @@ container = $container; // Allow singleton style calls once intanciated. // For this to work, the Translator service has to be instanciated very early. This is done manually // in TheliaHttpKernel, by calling $this->container->get('thelia.translator'); + parent::__construct(null); self::$instance = $this; } @@ -28,6 +38,11 @@ class Translator extends BaseTranslator return self::$instance; } + public function getLocale() + { + return $this->container->get('request')->getSession()->getLang()->getLocale(); + } + /** * {@inheritdoc} *