Gatsby starter with i18n/l10n support using js-lingui.
MIT License
Gatsby starter with i18n/l10n support using js-lingui. This will generate pages for each locale avoiding duplicate code.
Make sure that you have Gatsby and js-lingui installed globally:
npm install --global gatsby-cli js-lingui
Extract translations:
npm run extract
Run gatsby:
npm run develop
Add new locale (ex: russian):
lingui add-locale ru
Wire up catalogs in src/i18n-config
Refer to js-lingui docs for further information on using the library
You could have translated paths; for that you will need a mapping of default paths to localized paths. Update gatsby-node
and locale files to use those mappings.
These threads/repositories served as inspiration: https://github.com/gatsbyjs/gatsby/issues/3853#issuecomment-365216769 https://github.com/lingui/js-lingui/issues/158#issuecomment-371096693 https://github.com/morloy/ledgy.com