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

Sticky Locale based on User Entity #4862

Closed
peterrehm opened this issue Jan 16, 2015 · 3 comments
Closed

Sticky Locale based on User Entity #4862

peterrehm opened this issue Jan 16, 2015 · 3 comments

Comments

@peterrehm
Copy link
Contributor

I think it is a common requirement that you want to define your locale based on
a database value. E.g. the locale property of the user entity.

There is no direct way to access the user in the LocaleListener hence it is registered
before the FirewallListener and so no token exists.

How about an additional chapter explaining how to achieve this adding a listener to
the security.interactive_login event and storing the locale in this step?

If this is wanted I might find the time for a draft.

@xabbuh
Copy link
Member

xabbuh commented Jan 17, 2015

I would be 👍 on this.

@wouterj
Copy link
Member

wouterj commented Jan 17, 2015

I think it's a perfect topic for the cookbook (the Translation section). 👍

@peterrehm
Copy link
Contributor Author

I added it as chapter to the existing entry about the sticky locale session.

weaverryan added a commit that referenced this issue Mar 13, 2015
… (peterrehm)

This PR was merged into the 2.3 branch.

Discussion
----------

Added chapter about the locale based on the user entity

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | yes
| Applies to    | 2.3
| Fixed tickets | #4862

Commits
-------

1aaa491 Updated as per feedback.
0fc72a8 Updated as per feedback
6e986e1 Updated wording of the chapter as per discussion
66e21a9 Added chapter about the locale based on the user entity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants