Refactor i18n configuration and utility functions for improved clarity and simplicity
All checks were successful
SteamWarCI Build successful
All checks were successful
SteamWarCI Build successful
This commit is contained in:
@@ -47,7 +47,6 @@ export default defineConfig({
|
||||
configFile: "./tailwind.config.js",
|
||||
applyBaseStyles: false,
|
||||
}),
|
||||
configureI18n(),
|
||||
sitemap({
|
||||
i18n: {
|
||||
defaultLocale: "en",
|
||||
|
||||
@@ -19,23 +19,4 @@
|
||||
|
||||
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;
|
||||
};
|
||||
export const l = proxyL;
|
||||
|
||||
Reference in New Issue
Block a user