gatsby-plugin-intl icon indicating copy to clipboard operation
gatsby-plugin-intl copied to clipboard

Distinguish between default display/redirect language and default messages language

Open patspam opened this issue 3 years ago • 0 comments

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

patspam avatar Jan 08 '21 00:01 patspam