aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/ConfigController.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2017-06-12 17:23:35 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2017-12-12 20:33:48 +0100
commitdd50f50597720af7d39708a847b7e8604fd9d341 (patch)
tree179f84687994d80959bbbac54edffa27e9ba2410 /src/Wallabag/CoreBundle/Controller/ConfigController.php
parentd80e9931f5faa071c44453e03c4ac45025106a3f (diff)
downloadwallabag-dd50f50597720af7d39708a847b7e8604fd9d341.tar.gz
wallabag-dd50f50597720af7d39708a847b7e8604fd9d341.tar.zst
wallabag-dd50f50597720af7d39708a847b7e8604fd9d341.zip
Added possibility to change locale from login/register pages
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/ConfigController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php19
1 files changed, 19 insertions, 0 deletions
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
424 424
425 return $config; 425 return $config;
426 } 426 }
427
428 /**
429 * Change the locale for the current user.
430 *
431 * @param Request $request
432 * @param string $language
433 *
434 * @Route("/locale/{language}", name="changeLocale")
435 *
436 * @return \Symfony\Component\HttpFoundation\RedirectResponse
437 */
438 public function setLocaleAction(Request $request, $language = null)
439 {
440 if ($language != null) {
441 $this->get('session')->set('_locale', $language);
442 }
443
444 return $this->redirect($request->headers->get('referer'));
445 }
427} 446}