-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.pick ignores quality? #34
Comments
This is correct. In the pick, you should use the full languages you support, like |
Ah! |
I would advise to put full locales and nog languages in the array of options. Together with loose, you will in that case always get the full locale and will solve your issue:
Should in this case indeed return en-US as language matches. Using split you can extract the language from the locale. |
I added some tests for the readme examples and corrected the readme based on the results here: #35 |
I ran into specificity issues as well.
The expected result, to me, would be |
I think It is correct to return "nl" for this scenario.
"en-GB,nl" is like the first example replacing "fr" with "nl", so why it should provide "fr" if "en" or "de" are accepted (also within the same q in your scenario)? |
I believe in this case, See here: https://developer.mozilla.org/en-US/docs/Glossary/Quality_values Since this is a strict search, though, |
|
I'm trying to use incoming HTTP headers to serve up the most appropriate translation of a site, and it seems like
.pick
is exactly what I need, but it's not respecting the quality value of headers. When I run this:I would expect it to return
en
, but it's giving menl
. Is this on purpose or would you like a PR to fix it?The text was updated successfully, but these errors were encountered: