Refactored GetCulture to return null if cookie is missing or invalid, and added GetCultureOrDefault for fallback. Updated TestLocalizerController and CultureMiddleware to use new methods for more accurate culture detection. Localizer now returns only the localized string value.
Changed GetCulture to return current UI culture if cookie is missing, ensuring a non-null result. Reordered middleware in Program.cs to run ExceptionHandlingMiddleware after CultureMiddleware.
Added two endpoints to TestLocalizerController for retrieving culture from Accept-Language and user cookies. Enhanced GetCulture extension to parse and return the actual culture string from cookies. Updated usings for new extension methods.
Introduced a new extension method, GetCultureByAcceptLanguage, in the WebExtensions class. This method parses the Accept-Language header from the HTTP request and returns the first valid CultureInfo, enabling detection of the user's preferred culture from browser settings.