platformplatform / PlatformPlatform

Alpha state. A platform designed for building enterprise-grade, multi-tenant products using Azure, .NET, React, TypeScript, Infrastructure as Code, etc.
https://platformplatform.github.io
MIT License
257 stars 26 forks source link

Fix blank web page when locale is invalid by improving language fallback logic #599

Closed tjementum closed 1 month ago

tjementum commented 1 month ago

Summary & Motivation

Fix blank page being served where browser language settings like en or en-UK were uncritically used as the HTML Document language, even if translations weren't available for that exact locale. Now, the logic checks if a translation exists for the base language code (e.g., en), and if none is found, it falls back to en-US. This ensures that the document always has a valid locale that corresponds to available translations.

Checklist

linear[bot] commented 1 month ago

PP-216 Blank web page when locale is invalid

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud