You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #43108 [HttpKernel] Add basic support for language negotiation (GregoireHebert)
This PR was merged into the 5.4 branch.
Discussion
----------
[HttpKernel] Add basic support for language negotiation
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Continuation of #36507. Thanks `@GregoireHebert`!
This PR adds two options to the framework configuration:
- `set_locale_from_accept_language`: Makes the `Request`' locale automatically set based on the `Accept-Language` header (restricted by a new `framework.enabled_locales` config option which replaces `framework.translator.enabled_locales`).
The explicit `_locale` request attribute always wins over the `Accept-Language` header when it's set.
- `set_content_language_from_locale`: Sets the `Content-Language` Response header based on the `Request`' locale.
This is going to be useful for API Platform and related (e.g. Sylius/Sylius#11412).
Commits
-------
904b54f1f8 [HttpKernel] Add basic support for language negotiation
0 commit comments