diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/ConfigController.php | 19 |
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 | } |