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:
parent
43b6f3a8a8
commit
be417ef236
6 changed files with 31 additions and 3 deletions
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue