1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-08-26 18:21:02 +00:00

Added possibility to change locale from login/register pages

This commit is contained in:
Nicolas Lœuillet 2017-06-12 17:23:35 +02:00 committed by Jeremy Benoist
parent 43b6f3a8a8
commit be417ef236
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
6 changed files with 31 additions and 3 deletions

View file

@ -329,6 +329,25 @@ class ConfigController extends Controller
return $this->redirect($request->headers->get('referer'));
}
/**
* 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 (null !== $language) {
$this->get('session')->set('_locale', $language);
}
return $this->redirect($request->headers->get('referer'));
}
/**
* Remove all tags for given tags and a given user and cleanup orphan tags.
*