Closed gebbber closed 3 years ago
This is expected: https://github.com/tinganho/node-accept-language/blob/master/Tests/Test.ts#L96
You can think if someone requesting 'fr' that he wants a more generic 'fr'. 'fr-CA' is more specific and should fail(or take the default one).
We follow this standard: https://tools.ietf.org/html/rfc4647#section-3.4
Note one requesting for en-US
will resolve to en
, but one requesting for en
will not resolve to en-US
. One solution is to include fr
in available languages.
We could probably make the lookup rule work in both directions in the future, since some people expect it that way. Though, I'm very constrained in time right now.