feat: add some stuff

This commit is contained in:
2024-03-28 18:30:52 +01:00
parent 31b24de86c
commit d4128840b9
196 changed files with 3393 additions and 390 deletions

View File

@@ -1,5 +1,5 @@
---
import { locales, defaultLocale, getLocale } from "astro-i18n-aut";
import { locales, defaultLocale } from "astro-i18n-aut";
import { useTranslations } from "../i18n/utils";
function translatePath(lang: string) {
@@ -16,15 +16,16 @@ function translatePath(lang: string) {
return `/${[lang, ...split].join("/")}`;
}
const locale = getLocale(Astro.url);
const t = useTranslations(locale);
const t = useTranslations(Astro);
---
<ul>
{
Object.entries(locales).map(([lang, label]) => (
<li>
<a href={translatePath(lang)}>{t(label as "de")}</a>
<a href={translatePath(lang)} data-astro-prefetch>
{t(label as "de")}
</a>
</li>
))
}