mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
aaf0e52be4a268bdb7edea699ed2d47f88158f2c
Users were no longer sent to their preferred locale. `LocaleRedirector` was emptied in `115fa5aca` after its previous versions caused repeated redirects, and nothing replaced it. **Cause** - The earlier logic compared the best locale (a string) against the current locale entry (an object), so the check was always true on non-default locale pages - That made the redirect fire repeatedly, which led to the logic being removed entirely **Changes** - Derive the current locale from the URL, treating the default locale as unprefixed to match how pages are generated - Redirect only when the best locale differs from the current locale, so it stops after one hop - Redirect users with a saved `preferred-locale` from any page - Redirect users without a saved preference from default-locale URLs only, using their browser language, so shared locale links are respected - Preserve the rest of the path when swapping the locale prefix - Skip `/api` paths
BlitzKit
Tools for everything and anything, World of Tanks Blitz.
This GitHub repository contains the code for BlitzKit and all its services. If you are here, looking to use BlitzKit, go to https://blitzkit.app/.
If you intend to contribute to the code, note that you may need to check out sensitive, closed-source submodules to locally develop certain aspects of BlitzKit. Communicate with @tresabhi on Discord to get started or discuss sensitive content, such as environment variables or submodules.
Languages
TypeScript
96.2%
Astro
3.2%
GLSL
0.4%
CSS
0.2%