Compare commits

...
6 Commits
Author SHA1 Message Date
TrèsAbhi f478a08bd9 New Crowdin updates (#211)
* New translations en.json (Polish)

* New translations en.json (Russian)

* New translations en.json (Russian)
2026-02-13 07:25:48 -06:00
TrèsAbhi 115fa5acad Remove locale redirection logic
Removed locale redirection logic from LocaleRedirector component.
2026-02-12 07:14:11 -06:00
TrèsAbhi c24a2989fa Fix locale redirection logic in LocaleRedirector.astro 2026-02-12 06:31:43 -06:00
TrèsAbhi a6cfb522b3 fix: remove cue4parse 2026-02-11 15:22:30 -06:00
TrèsAbhi 12e645f6e2 fix: legacy redirector ensure props 2026-02-11 15:20:09 -06:00
TrèsAbhi 9a3f64fcd6 Refactor locale redirection logic in LocaleRedirector 2026-02-11 09:31:48 -06:00
5 changed files with 10 additions and 32 deletions

No files matched your search

+4 -4
View File
@@ -493,7 +493,7 @@
"description": "Search clans", "description": "Search clans",
"options": { "options": {
"limit": { "limit": {
"name": "limit", "name": "",
"description": "The max number of clan results (default: {limit})" "description": "The max number of clan results (default: {limit})"
} }
}, },
@@ -507,7 +507,7 @@
"description": "Search players", "description": "Search players",
"options": { "options": {
"limit": { "limit": {
"name": "limit", "name": "",
"description": "The max number of player results (default: {limit})" "description": "The max number of player results (default: {limit})"
} }
}, },
@@ -531,7 +531,7 @@
}, },
"options": { "options": {
"limit": { "limit": {
"name": "limit", "name": "",
"description": "How many neighbors to display (default: {count})" "description": "How many neighbors to display (default: {count})"
}, },
"season": { "season": {
@@ -675,7 +675,7 @@
"active": "{name} (Active)", "active": "{name} (Active)",
"no_tanks_found": { "no_tanks_found": {
"body": "No tanks found.", "body": "No tanks found.",
"search_again": "Try searching again.", "search_again": "",
"clear_filters": "Try clearing filters." "clear_filters": "Try clearing filters."
}, },
"sort": { "sort": {
+2 -2
View File
@@ -24,7 +24,7 @@
"shells": { "shells": {
"ap": "ББ", "ap": "ББ",
"ap_cr": "БП", "ap_cr": "БП",
"hc": "ОФ", "hc": "КС",
"he": "ОФ" "he": "ОФ"
}, },
"player_count_period": { "player_count_period": {
@@ -39,7 +39,7 @@
"branches": { "branches": {
"local": "dev", "local": "dev",
"dev": "бета", "dev": "бета",
"opentest": "открытый тест", "opentest": "общий тест",
"preview": "превью" "preview": "превью"
}, },
"locales": { "locales": {
@@ -1,26 +1,3 @@
<script> <script>
import locales from "@blitzkit/i18n/locales.json";
import { getBestLocale } from "../core/i18n/getBestLocale";
const isAPI = window.location.pathname.startsWith("/api");
const isI18nPath = locales.supported.some(({ locale }) =>
window.location.pathname.startsWith(`/${locale}/`)
);
const bestLocale = getBestLocale();
const currentPath = locales.supported.find(({ locale }) =>
window.location.pathname.startsWith(`/${locale}/`)
);
if (
!isAPI && // not an api, duh!
localStorage.getItem("preferred-locale") !== null && // no preference, so probably google's crawler
bestLocale !== currentPath?.locale // we need to redirect
) {
window.location.pathname = isI18nPath
? window.location.pathname.replace(
`/${currentPath?.locale}`,
bestLocale === undefined ? "" : `/${bestLocale}`
)
: `/${bestLocale}${window.location.pathname}`;
}
</script> </script>
@@ -5,11 +5,11 @@ export function getBestLocale() {
localStorage.getItem("preferred-locale") ?? localStorage.getItem("preferred-locale") ??
navigator.language.split("-")[0]; navigator.language.split("-")[0];
const isSupported = locales.supported.some( const isSupported = locales.supported.some(
({ locale }) => locale === desiredLocale ({ locale }) => locale === desiredLocale,
); );
const isDefault = desiredLocale === locales.default; const isDefault = desiredLocale === locales.default;
if (!isSupported || isDefault) return undefined; if (!isSupported || isDefault) return locales.default;
return desiredLocale; return desiredLocale;
} }
@@ -12,7 +12,8 @@ export const getStaticPaths = (async () => {
.map((tank) => .map((tank) =>
parentPaths.map((parent) => ({ parentPaths.map((parent) => ({
params: { ...parent.params, id: tank.id }, params: { ...parent.params, id: tank.id },
})) props: parent.props,
})),
) )
.flat(); .flat();
}) satisfies GetStaticPaths; }) satisfies GetStaticPaths;