martinkr / next-export-i18n

Internationalize (18n) next.js with true support for next export
MIT License
247 stars 37 forks source link

Make Language autodétection optional #12

Closed martinkr closed 2 years ago

martinkr commented 2 years ago

Thanks for the explanation! I understand how it works, but what happens if:

  1. I provide translations for English and Balinese (just for the sake of this example).
  2. The website is mostly targeted towards people who speak Balinese, so I set the default language to Balinese.
  3. There's no Balinese language support in most browsers, so users are likely to use another language for the browser (e.g. English).
  4. Now the default language of the website for the users becomes English, which is not what I'm aiming for.

This also happens if the user just happens to be using the browser in English (e.g. the browser comes preinstalled with the laptop, and it's set to English) and they're not tech-savvy enough to know how to change it.

Originally posted by @laymonage in https://github.com/martinkr/next-export-i18n/issues/9#issuecomment-1012987648

martinkr commented 2 years ago

Implemented in 1.4.0

The config-file has an additional option useBrowserDefault now. Set this to false to forcefully overwrite the browser's default language with the one set in the config.