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] Use Accept-Language header even if there are no enabled locales#47377
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
chalasr commentedAug 31, 2022
Can you add a test case that breaks before your patch? |
MatTheCat commentedAug 31, 2022 • 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.
@chalasr done. While updating |
c20d409 to0a81366Compare89c118d to8a39eebComparefabpot commentedSep 20, 2022
@MatTheCat Can you create a PR on 4.4 for the tests fix? |
MatTheCat commentedSep 21, 2022 • 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.
…ers (MatTheCat)This PR was merged into the 5.4 branch.Discussion----------[HttpKernel] Fix LocaleListenerTest Accept-Language headers| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets |Fixsymfony/symfony#47377 (comment)| License | MIT| Doc PR | N/ACommits-------b6ac197fa4 Fix LocaleListenerTest Accept-Language headers
chalasr commentedSep 21, 2022 • 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.
MatTheCat commentedSep 21, 2022
Damn okay sorry 😅 PR rebased! |
chalasr commentedSep 21, 2022
No worries, I'd say it should be improved on Github :) |
MatTheCat commentedSep 21, 2022
WDYT? Don’t really know how to make it shorter. |
chalasr commentedSep 21, 2022
Works for me! |
Uh oh!
There was an error while loading.Please reload this page.
fabpot commentedSep 23, 2022
Thank you@MatTheCat. |
nicolas-grekas commentedSep 23, 2022
I'm a bit late here but this means we are going to always send the Vary: Accept-Language header, isn't it? I'm not sure this is legit. |
MatTheCat commentedSep 23, 2022 • 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.
@nicolas-grekas only if |
nicolas-grekas commentedSep 23, 2022 • 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.
Oh, thanks. Two other issues: why on 6.2 and not on 6.1? And more importantly: the vary header should also be sent when $preferredLanguage is falsy. The code should look like this: }elseif ($this->useAcceptLanguageHeader) {if ($preferredLanguage =$request->getPreferredLanguage($this->enabledLocales)) {$request->setLocale($preferredLanguage); }$request->attributes->set('_vary_by_language',true); } Can you please send a PR on 6.1 if you agree? |
MatTheCat commentedSep 23, 2022
I’m not sure about you two questions 😞 so I’ll wait for the approval of other members before submitting another PR. |
chalasr commentedSep 23, 2022
Nicolas is right, please go ahead if you want/can. |
…no enabled locales (MatTheCat)This PR was squashed before being merged into the 6.1 branch.Discussion----------[HttpKernel] Use Accept-Language header even if there are no enabled locales| Q | A| ------------- | ---| Branch? | 6.1| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets |Fix#47377| License | MIT| Doc PR | N/ACommits-------d97d51c [HttpKernel] Use Accept-Language header even if there are no enabled locales
Uh oh!
There was an error while loading.Please reload this page.
Don’t really know how I should consider this PR 🤔
It would affect people setting
set_locale_from_accept_languagetotruewith noenabled_localeswhen the request has a preferred language: