oqtane / oqtane.framework

CMS & Application Framework for Blazor & .NET MAUI
http://www.oqtane.org
MIT License
1.9k stars 547 forks source link

parsedCulture capture null #4805

Closed leigh-pointer closed 2 weeks ago

leigh-pointer commented 2 weeks ago

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

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

sbwalker commented 2 weeks ago

@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 commented 2 weeks ago

@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!