X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FController%2FConfigController.php;fp=src%2FWallabag%2FCoreBundle%2FController%2FConfigController.php;h=7fc8fb699c14f6d05331dd6543d1bf9f7b380d32;hb=dd50f50597720af7d39708a847b7e8604fd9d341;hp=a89bb7805b6bc98c9129620eaaa8ff4016c65efb;hpb=d80e9931f5faa071c44453e03c4ac45025106a3f;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index a89bb780..7fc8fb69 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -424,4 +424,23 @@ class ConfigController extends Controller return $config; } + + /** + * Change the locale for the current user. + * + * @param Request $request + * @param string $language + * + * @Route("/locale/{language}", name="changeLocale") + * + * @return \Symfony\Component\HttpFoundation\RedirectResponse + */ + public function setLocaleAction(Request $request, $language = null) + { + if ($language != null) { + $this->get('session')->set('_locale', $language); + } + + return $this->redirect($request->headers->get('referer')); + } }