8000 best() returning traditional chinese when it should be returning simplified chinese · Issue #33 · florrain/locale · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
best() returning traditional chinese when it should be returning simplified chinese #33
Open
@kellenwheaton

Description

@kellenwheaton

My supported locales are:

["en", "fr", "de", "zh-hant", "zh-hans"]

In Chrome my language settings are:
screen shot 2016-02-19 at 4 05 40 pm
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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet 2DE1

    Development

    No branches or pull requests

    Issue actions

      0