-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
ContentRequestCultureProvider does not set cookie based on content Culture #12610
Comments
Did you enable the Content Localization required features? |
Yes, of course. |
Could you please try it in a Private Window may be there's a caching issue, if the issue still we need to check then |
Hi, i tried an "Empty cache and Hard reload", but i can confirm that it seems not to be a cache issue. Another info: the main menu got the Localization Part and has 2 localizations, but it does not changes the items according with the Picker. it remains always with the default Culture items When i change the URL to the other Culture, the Picker remains on the old culture, then, if i change the culture using the Picker the page does not change (because i was already on the correct page. (that seems to work as expected) Manually hacking the cookie value, i found that the Picker (at refresh) reads the cookie and reflects what is on the cookie, but no menu nor content reflects the new cookie value. |
I found that there is only ONE reference to ContentRequestCultureProvider(), in the Startup.cs of OrchardCore.ContentLocalization that is responsible to setting the cookie services.Configure(options => options.AddInitialRequestCultureProvider(new ContentRequestCultureProvider())); Debugging i found that the DetermineProviderCultureResult is never called after the first request Now the question is: for testing I'm using the "TheBlogTheme" I'm wondering if there can be conflicts between ContentParts (some with LocaliztionPart, some without) |
/cc @jptissot |
@hishamco The change in code is creating a new instance of |
I will check this one .. |
@Dredy I enabled |
Content.Culture.Picker.mp4 |
Furthermore we SHOULD NOT ignore the current culture provider(s) |
For reference #13093 |
@hishamco to reproduce You have to change the url to /about-1 and /about-2 |
@Dredy could you try my PR? |
Setting the ContentRequestCultureProvider "Set Cookie" on the Localization section does not sets the cookie based on the Content culture.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I'm expecting that the Culture Picker will reflect the ContentItem.Content.LocalizationPart.Culture
and also the .AspnetCore.Culture cookie will reflect the ContentItem.Content.LocalizationPart.Culture
The text was updated successfully, but these errors were encountered: