--- import { locales, defaultLocale, getLocale } from "astro-i18n-aut"; import { useTranslations } from "../i18n/utils"; const reg = new RegExp(`^\/(${Object.keys(locales).join("|")})\/`); function translatePath(lang: string) { const p = Astro.url.pathname.replace(reg, "").replace(/^\//, ""); if (lang === defaultLocale) return `/${p}`; return `/${lang}/${p}`; } const locale = getLocale(Astro.url); const t = useTranslations(locale); ---