Skip to content

tylergaw/astro-example-i18next

Repository files navigation

Astro with i18next Example

⚠️ Note: This isn't complete yet. There's still known issues with the Trans component and I'm sure unknown issues.

An opinionated approach to translation with Astro and i18next.

Technology overview

Translation overview

  • 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.

About

An opinionated approach to translation with Astro and i18next.

Topics

Resources

Stars

Watchers

Forks