Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AdminBundle] Make AdminLocaleListener also update locale on subrequests #499

Conversation

bureaublauwgeel
Copy link

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets

Since Symfony 2.6 it seems to be necessary to also update the locale on subrequests. This becomes apparent when viewing a backend pag with a subrequest while the request locale (by virtue of the default locale) is not equal to an admin locale of a backend user. In my case I had my default locale set to Dutch (nl) and the backend locale set to English (en). This resulted in the dashboard page using Dutch translations, while the rest of the backend uses English translations.

Apparently this is caused by a refactor of the TranslatorListener in Symfony 2.6, which also acts on subrequests. I'm not certain if checking for a subrequest is still needed in Symfony 2.5, if so we need to look for another solution.

@roderik
Copy link
Contributor

roderik commented Jun 18, 2015

Let's assume it works until someone yells at me for breaking it :)

@roderik roderik added this to the 3.2.0 milestone Jun 18, 2015
roderik pushed a commit that referenced this pull request Jun 18, 2015
…r-symfony-2.6

Make AdminLocaleListener also update locale on subrequests
@roderik roderik merged commit 2c4afc9 into Kunstmaan:master Jun 18, 2015
@roderik roderik changed the title Make AdminLocaleListener also update locale on subrequests [AdminBundle] Make AdminLocaleListener also update locale on subrequests Jun 18, 2015
@bureaublauwgeel bureaublauwgeel deleted the fix-admin-locale-listener-symfony-2.6 branch July 8, 2015 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants