gatsby-plugin-intl
gatsby-plugin-intl copied to clipboard
Distinguish between default display/redirect language and default messages language
This plugin conflates two different types "default languages" concepts:
- The language you want to display/redirect to when the user visits
/
- The language that your codebase is written in (which JSON messages file
react-intl
should read default messages from)
gatsby-plugin-intl
assumes these are both the same, but this is not always true.
For example, strings in my codebase are written in en-GB
(because our dev team is in Australia), but the default language for our site is en-US
(because it's a global site and US is the bigger market).
ie. I want to be able to tell gatsby-plugin-intl
to use en-US
as the default language when the user visits /
(and possibly redirect to /en-US/
, but use en-GB.json
as the default messages file when a translated string is not available.