diff --git a/packages/cue4parse b/packages/cue4parse new file mode 160000 index 000000000..b8c9dab50 --- /dev/null +++ b/packages/cue4parse @@ -0,0 +1 @@ +Subproject commit b8c9dab50010ac800e6810622e71f6ca8874a288 diff --git a/packages/website/src/components/LocaleRedirector.astro b/packages/website/src/components/LocaleRedirector.astro index 3839cd86e..b7ed9ce26 100644 --- a/packages/website/src/components/LocaleRedirector.astro +++ b/packages/website/src/components/LocaleRedirector.astro @@ -4,11 +4,11 @@ const isAPI = window.location.pathname.startsWith("/api"); const isI18nPath = locales.supported.some(({ locale }) => - window.location.pathname.startsWith(`/${locale}/`) + window.location.pathname.startsWith(`/${locale}/`), ); const bestLocale = getBestLocale(); const currentPath = locales.supported.find(({ locale }) => - window.location.pathname.startsWith(`/${locale}/`) + window.location.pathname.startsWith(`/${locale}/`), ); if ( @@ -19,8 +19,8 @@ window.location.pathname = isI18nPath ? window.location.pathname.replace( `/${currentPath?.locale}`, - bestLocale === undefined ? "" : `/${bestLocale}` + bestLocale === undefined ? "" : `/${bestLocale}`, ) - : `${bestLocale ? `/${bestLocale}` : ""}${window.location.pathname}`; + : `${bestLocale}${window.location.pathname}`; } diff --git a/packages/website/src/core/i18n/getBestLocale.ts b/packages/website/src/core/i18n/getBestLocale.ts index 80458cf98..67a5edf85 100644 --- a/packages/website/src/core/i18n/getBestLocale.ts +++ b/packages/website/src/core/i18n/getBestLocale.ts @@ -5,11 +5,11 @@ export function getBestLocale() { localStorage.getItem("preferred-locale") ?? navigator.language.split("-")[0]; const isSupported = locales.supported.some( - ({ locale }) => locale === desiredLocale + ({ locale }) => locale === desiredLocale, ); const isDefault = desiredLocale === locales.default; - if (!isSupported || isDefault) return undefined; + if (!isSupported || isDefault) return locales.default; return desiredLocale; } diff --git a/packages/website/src/pages/[...locale]/tools/tankopedia/[id]/index.astro b/packages/website/src/pages/[...locale]/tools/tankopedia/[id]/index.astro index 303907b1c..d5a571f74 100644 --- a/packages/website/src/pages/[...locale]/tools/tankopedia/[id]/index.astro +++ b/packages/website/src/pages/[...locale]/tools/tankopedia/[id]/index.astro @@ -12,7 +12,8 @@ export const getStaticPaths = (async () => { .map((tank) => parentPaths.map((parent) => ({ params: { ...parent.params, id: tank.id }, - })) + props: parent.props, + })), ) .flat(); }) satisfies GetStaticPaths;