From c41b1f9daa8a163062a9ba2af1435bece6159d34 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 23 Apr 2026 11:53:56 +0200 Subject: [PATCH] Refactor i18n configuration and utility functions for improved clarity and simplicity --- astro-i18n.config.ts | 2 +- astro.config.mjs | 1 - src/util/util.ts | 23 ++--------------------- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/astro-i18n.config.ts b/astro-i18n.config.ts index c1a4391..92d1bff 100644 --- a/astro-i18n.config.ts +++ b/astro-i18n.config.ts @@ -24,4 +24,4 @@ export default defineAstroI18nConfig({ "passwort-setzen": "set-password", }, }, -}); \ No newline at end of file +}); diff --git a/astro.config.mjs b/astro.config.mjs index da0f4cb..248a02e 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -47,7 +47,6 @@ export default defineConfig({ configFile: "./tailwind.config.js", applyBaseStyles: false, }), - configureI18n(), sitemap({ i18n: { defaultLocale: "en", diff --git a/src/util/util.ts b/src/util/util.ts index aeebce1..2a4c3b0 100644 --- a/src/util/util.ts +++ b/src/util/util.ts @@ -17,25 +17,6 @@ * along with this program. If not, see . */ -import {l as proxyL} from "astro-i18n"; +import { l as proxyL } from "astro-i18n"; -const locales = [ - "en", - "de", -]; - -export const l = (route: string) => { - const transPath = proxyL(route); - - if (import.meta.env.DEV) { - return transPath; - } - - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const [_, locale, ...rest] = transPath.split("/"); - if (locales.includes(locale)) { - return "/" + rest.join("/"); - } - - return transPath; -}; \ No newline at end of file +export const l = proxyL;