Trans
component and I'm sure unknown issues.
An opinionated approach to translation with Astro and i18next.
- English astro-example-i18next.netlify.app
- Spanish astro-example-i18next-es.netlify.app
- French astro-example-i18next-fr.netlify.app
- Astro
- i18next
- react-i18next
- i18next-parser
- Hosted on Netlify
- Translation is done at build time
- This is a domain (would also work for subdomain) approach for locales. Each language has a different domain
- Each language has a separate site in Netlify
- The
LANGUAGE
env var is used to specify which locale to build for;LANGUAGE=es yarn build
- English is the default and fallback language. If a translation is not available in the requested language, we use the English version to avoid blank strings
- When possible, we use the English text as the key for each translation in the locale files. This makes it easier to edit text in pages, components, etc. since it lets us see the text.