This project uses a simple i18n system with three main tools:
For most text content. Keys are defined in content.ts.
const t = useTranslations(Astro.currentLocale);
const text = t("home.hero.header"); // "Test"For short text that relates to untranslated content (units, titles, etc).
const unit = t.map({ en: "kg", nl: "kg" });
const title = t.map({ en: "CEO", nl: "Directeur" });Last resort for direct HTML manipulation based on locale.
<When lang="en">English content</When>
<When lang="nl">Dutch content</When>Add new translations to src/i18n/content.ts in the ui object.