Closed StevenLangbroek closed 8 years ago
Check the value of "process.env.LANG" -- in many cases (my mac for example), the LANG environment variable is set to en_us or something. If it's not set hte code still defaults to 'en-US'. I'd rather make it default to the first supported lang imo, but that'd be a breaking change.
As soon as https://github.com/jed/locale/pull/20 is merged you can set an instance default
Released version 0.1.0 that includes the fix for this.
I have a client who's launching in 1 market at a time. I read "available locales" by looking for subdirectories in the 'locales' folder. Right now, there's 1 locale in there (
de
), which results in this availability array:[ 'de' ]
. I then initializelocale
like so:If someone who doesn't have
de
in theirAccept-Language
header (like my client), it tries to fall back toen_US
... Is this expected behavior, considering the available locales I passed in? It seems weird it just moves on with the user's first locale.I catch it for now, but it's a bit of a hack imho:
Would love to hear your input.