From: Vincent Vanwaelscappel Date: Tue, 8 Dec 2020 20:28:43 +0000 (+0100) Subject: wip #3753 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=cff7f61007f7062fd148fe4293c6fd73a15bdf75;p=cubist_cms-back.git wip #3753 @0.5 --- diff --git a/src/app/Middleware/BackLocaleSelector.php b/src/app/Middleware/BackLocaleSelector.php new file mode 100644 index 0000000..e913396 --- /dev/null +++ b/src/app/Middleware/BackLocaleSelector.php @@ -0,0 +1,29 @@ +setLocale($locale); + + return $this->getResponse(); + } + + public function setLocale($locale) + { + App::setLocale($locale); + config(['app.fallback_locale' => $locale]); + app('translator')->setLocale($locale); + app('translator')->setFallback($locale); + } +}