Files
Tiber365/astro-i18next.config.mjs
becarta 3168826fa8 Add internationalization support with astro-i18next integration
- Implemented astro-i18next for multi-language support, including English, Dutch, and Italian.
- Configured default locale and language fallback settings.
- Defined routes for localized content in the configuration.
- Updated package.json and package-lock.json to include new dependencies for i18next and related plugins.
2025-05-23 15:10:00 +02:00

57 lines
1.3 KiB
JavaScript

/** @type {import('astro-i18next').AstroI18nextConfig} */
export default {
defaultLocale: "en",
locales: ["en", "nl", "it"],
namespaces: ["translation"],
defaultNamespace: "translation",
load: ["server", "client"],
i18nextServer: {
debug: true,
initImmediate: false,
supportedLngs: ["en", "nl", "it"],
fallbackLng: "en",
ns: ["translation"],
defaultNS: "translation",
resources: {
en: {
translation: () => import("../public/locales/en/translation.json")
},
nl: {
translation: () => import("../public/locales/nl/translation.json")
},
it: {
translation: () => import("../public/locales/it/translation.json")
}
}
},
i18nextClient: {
debug: false,
supportedLngs: ["en", "nl", "it"],
fallbackLng: "en",
ns: ["translation"],
defaultNS: "translation"
},
routes: {
en: {
about: 'about',
services: 'services',
contact: 'contact',
privacy: 'privacy',
terms: 'terms'
},
nl: {
about: 'over-ons',
services: 'diensten',
contact: 'contact',
privacy: 'privacy',
terms: 'voorwaarden'
},
it: {
about: 'chi-siamo',
services: 'servizi',
contact: 'contatti',
privacy: 'privacy',
terms: 'termini'
}
}
};