Closed SimeonC closed 7 years ago
I agree.
If we propose ['en', 'fr']
in our list, 'fr-BE'
or 'fr-FR'
should match with 'fr'
and not default to 'en'
.
hm, I probably misinterpretted RFC 4647 https://tools.ietf.org/html/rfc4647#section-3.4.
I thought, that it shouldn't match a more specific fr-BE
with a more broader one fr
. I have done the opposite. If you support zh-CN
and the user requests zh
it will return zh-CN
, but not the other way around.
But after having read through the docs. It seems I've done wrong. I will read it more carefully later and maybe correct this.
@tinganho any feedback on this yet?
@micky2be Sorry for the delay. I will try to take a closer look in the very close future :)
But it seems like we should only revert the matching algo.
This should be now fixed and it conforms now to RFC 4647 https://tools.ietf.org/html/rfc4647#section-3.4.
Scenario:
As you can see in this example accept language doesn't fallback to the closest match. I'm not sure if this is a bug or the intended way of working. From your tests it appears you support the other way around - less specific get returns the closest defined language.