Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpKernel] Add basic support for language negotiation#43108
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
GregoireHebert commentedSep 20, 2021
Thank you for taking over :-) |
stof commentedSep 20, 2021
Using the |
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
d491c3b to9f0e400CompareUh oh!
There was an error while loading.Please reload this page.
75e8338 to456df0fCompare
OskarStark left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Minor
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/HttpKernel/EventListener/ResponseListener.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
53f82a0 to59317c0Comparechalasr commentedOct 5, 2021
This PR is ready. |
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/HttpKernel/EventListener/LocaleListener.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
derrabus left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Some nit-picking. 🙂
Looks good, thank you!
src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
chalasr commentedOct 5, 2021
Thanks for the reviews! All fixed now |
derrabus commentedOct 5, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thank you@GregoireHebert and@chalasr. |
…(hiddewie)This PR was squashed before being merged into the 5.4 branch.Discussion----------[HttpKernel] Add basic support for language negotiationFromsymfony/symfony#43108Fixes#15891I moved the documentation for the deprecated option with a deprecation notice at the old place.The new options `set_content_language_from_locale` and `set_locale_from_accept_language` have been documented.Commits-------c41db2f [HttpKernel] Add basic support for language negotiation
…rs (maxhelias)This PR was merged into the 5.4 branch.Discussion----------[FrameworkBundle] ResponseListener needs only 2 parameters| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | -| New feature? | no| Deprecations? | no| Tickets | -| License | MIT| Doc PR | -Introduced in 5.4 with :#43108Commits-------6074226 ResponseListener needs only 2 parameters
…riate (nicolas-grekas)This PR was merged into the 5.4 branch.Discussion----------[HttpKernel] fix sending Vary: Accept-Language when appropriate| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets | -| License | MIT| Doc PR | -That's something I figured our while reviewing#44386 and that we missed in#43108:the `Vary` header should be sent when we use `Accept-Language`, not when we send `Content-Language`./cc@chalasrCommits-------afab34d [HttpKernel] fix sending Vary: Accept-Language when appropriate
Uh oh!
There was an error while loading.Please reload this page.
Continuation of#36507. Thanks@GregoireHebert!
This PR adds two options to the framework configuration:
set_locale_from_accept_language: Makes theRequest' locale automatically set based on theAccept-Languageheader (restricted by a newframework.enabled_localesconfig option which replacesframework.translator.enabled_locales).The explicit
_localerequest attribute always wins over theAccept-Languageheader when it's set.set_content_language_from_locale: Sets theContent-LanguageResponse header based on theRequest' locale.This is going to be useful for API Platform and related (e.g.Sylius/Sylius#11412).