Skip to content

Add note about LocaleListener #8411

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

Merged
merged 4 commits into from
Jan 5, 2018
Merged

Add note about LocaleListener #8411

merged 4 commits into from
Jan 5, 2018

Conversation

Steveb-p
Copy link
Contributor

@Steveb-p Steveb-p commented Sep 20, 2017

LocaleListener uses information provided by Request object.
Setting your own Listener, which is supposed to change request object locale, without priority results in LocaleListener already having it's locale set up and not reacting at all. This change adds this warning to documentation.

LocaleListener uses information provided by Request object. Setting it after LocaleListener read the object results in no effect.

Using a listener like this requires that it is called **before**
LocaleListener attempts to access it. In Symfony Framework it is called
with priority 8 by default. You will need to set your event listener
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better not to write the priority number if it changes
Just talk about defining the listener with a higher priority than the locale one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated accordingly. Thanks.

@javiereguiluz
Copy link
Member

Thank you @Steveb-p.

@javiereguiluz javiereguiluz merged commit 531909d into symfony:3.3 Jan 5, 2018
javiereguiluz added a commit that referenced this pull request Jan 5, 2018
This PR was merged into the 3.3 branch.

Discussion
----------

Add note about LocaleListener

LocaleListener uses information provided by Request object.
Setting your own Listener, which is supposed to change request object locale, without priority results in LocaleListener already having it's locale set up and not reacting at all. This change adds this warning to documentation.

Commits
-------

531909d Reword
1492f3e Remove information about default priority
52681f4 Fix missing blank line
03de10f Add note about LocaleListener
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.

3 participants