Use language setting of users when logging in.

This commit is contained in:
Jan Böhmer 2019-09-12 17:50:33 +02:00
parent 0dd20394cb
commit 0bfcec77fb
9 changed files with 97 additions and 8 deletions

View file

@ -28,6 +28,7 @@ security:
check_path: login
csrf_token_generator: security.csrf.token_manager
use_referer: true
default_target_path: '/'
logout:
path: logout

View file

@ -1,3 +1,10 @@
#index:
# path: /
# controller: App\Controller\DefaultController::index
# Redirect every url without an locale to the locale of the user/the global base locale
redirector:
path: /{url}
requirements:
url: ".*"
controller: App\Controller\RedirectController:addLocalePart

View file

@ -2,7 +2,4 @@ controllers:
resource: ../../src/Controller/
type: annotation
prefix:
en: '/en'
de: '/de'
'%locale%': '/'
prefix: '{_locale}'

View file

@ -49,6 +49,10 @@ services:
- name: doctrine.orm.entity_listener
App\Controller\RedirectController:
arguments:
$default_locale: '%locale%'
App\Command\UpdateExchangeRatesCommand:
arguments:
$base_current: '%default_currency%'