Skip to content
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

Unexpected case sensitivity in the language search results #18

Closed
imnasnainaec opened this issue Apr 23, 2024 · 5 comments
Closed

Unexpected case sensitivity in the language search results #18

imnasnainaec opened this issue Apr 23, 2024 · 5 comments

Comments

@imnasnainaec
Copy link
Contributor

When I type "es-CO" there are two results: first "es-CO" and second "es". This makes sense to me.
When I type "es-Co" or "es-co" there is only one result: "es".

Similarly, if I type "en", then English ("en") is the first result.
However, "En" only gives En ("enc") as the second result and English ("en") as the 7th result, which I have to scroll to find.

@gtryus
Copy link
Contributor

gtryus commented Apr 29, 2024

The comment is interesting although I think the bcp-47 standard is specific on the cases to be used for language identifiers and country codes. So in fact, I think the program is working according to the standard.

@imnasnainaec
Copy link
Contributor Author

Now when I try "En" in the demo (http://mui-language-picker-demo.org.s3-website-us-east-1.amazonaws.com/), I have to scroll a very long time to get past the "English"es and find "En (enc)".

@DavidLRowe
Copy link

By convention, the different subtags of a language tag are formatted differently (language in lowercase, script in Title case, region in CAPS, etc.), however, the case difference doesn't change the meaning. "In [BCP47], subtags can consist of upper or lowercase ASCII letters (the case carries no distinction) or ASCII digits." Language Tags and Locale Identifiers for the World Wide Web

I don't know if that makes a difference to the logic of the program. If a user enters "En" should you give preference to language names over language codes?

@gtryus
Copy link
Contributor

gtryus commented Apr 30, 2024

I added a change that puts the canonical name at the beginning of the list of matches.

@gtryus gtryus closed this as completed Apr 30, 2024
@imnasnainaec
Copy link
Contributor Author

For reference: 106d5ac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants