Open
Description
My supported locales are:
["en", "fr", "de", "zh-hant", "zh-hans"]
In Chrome my language settings are:
My current accept-language header is:
zh-CN,zh;q=0.8,zh-TW;q=0.6,en;q=0.4,en-US;q=0.2
After the following code:
locales = new locale.Locales(req.headers["accept-language"]);
bestLocale = (locales.best(supportedLocales) || "").toString();
bestLocale is "zh-hant"
, rather than "zh-hans"
, and traditional chinese is what's shown to the user. In the meantime I'm manually returning "zh-hans" when the first language in the header is zh-CN.
Metadata
Metadata
Assignees
Labels
No labels