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

parsedCulture capture null #4805

Closed
wants to merge 1 commit into from

Conversation

leigh-pointer
Copy link
Contributor

Returns null on a fresh installation of windows os and Oqtane.

Shared.CookieRequestCultureProvider.ParseCookieValue(culture).Culture.Name;

@sbwalker
Copy link
Member

sbwalker commented Nov 8, 2024

@leigh-pointer I am confused why this logic would fail. The ParseCookieValue() method simply parses a culture string (ie. "c=en|uic=en") into a RequestCulture object. If the culture string is null or empty string it will not attempt to parse it. So I am wondering what value the culture string contains in your installation? Its important to be able to understand this in order to validate that this is the correct solution.

                    if (!string.IsNullOrEmpty(culture))
                    {
                        _language = Shared.CookieRequestCultureProvider.ParseCookieValue(culture).Culture.Name;
                    }

@sbwalker
Copy link
Member

sbwalker commented Nov 8, 2024

@leigh-pointer I deleted the culture cookie in browser and reloaded the page and realized that in this scenario the system loads the default Language for the site (ie. "en") however it then needs to convert it into a Culture string (ie. "c=en|uic=en"). PR #4811 resolves this issue. Thank you for reporting!

@sbwalker sbwalker closed this Nov 8, 2024
@leigh-pointer leigh-pointer deleted the ParseCookieValue branch November 9, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants