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

Locales are not presented in alphabetical order. #911

Open
pixelzoom opened this issue Mar 1, 2023 · 6 comments
Open

Locales are not presented in alphabetical order. #911

pixelzoom opened this issue Mar 1, 2023 · 6 comments

Comments

@pixelzoom
Copy link
Contributor

On the Localization tab of the Preferences dialog, the locales are not in alphabetical order. See screenshot below. It looks like they are ordered by locale code (which is not displayed) instead of by Locale.name or Locale.localizedName. It's not clear which of those should determine the ordering, but ordering them by locale code seems buggy.

screenshot_2326

@chrisklus
Copy link
Contributor

chrisklus commented Mar 8, 2023

In design meeting with @jessegreenberg @amanda-phet @catherinecarter and @samreid:

We considered three different ways of sorting: by locale code (current), by english name, and by localized name. We decided that sorting by localizedName made the most sense because it seemed the least biased towards devs and the english language.

@samreid also asked ChatGPT and it said that sorting by localized name makes sense because sort functions use unicode placement after alphabetical, so this should be close to the universal way of sorting them.

@chrisklus
Copy link
Contributor

Committed above. Here is the new order:

image

@amanda-phet
Copy link

@samreid can you paste in the reference for why this is a reasonable sort?

@samreid
Copy link
Member

samreid commented Mar 8, 2023

I asked:

How would you sort this list? عربي, English, 中国人 ?

ChatGPT replied:

To sort the list ["عربي", "English", "中国人"] correctly, you would need to use a sorting method that takes into account the different character sets used by each language. In this case, you could sort the list using Unicode collation order, which is an internationally recognized standard for sorting multilingual text.

and provided a code example of how to implement it.

@jessegreenberg
Copy link
Contributor

Thanks for committing 53c86e0 @chrisklus! Are there any next steps for this issue? Do we need any other tests to make sure it is OK to sort availableRuntimeLocales instead of doing that view side?

@zepumph
Copy link
Member

zepumph commented Mar 9, 2023

RE: 53c86e0

This changed the PhET-iO API and required stable API validation. Now the localeProperty validValues is a different order.

zepumph added a commit that referenced this issue Jul 15, 2024
Signed-off-by: Michael Kauzmann <michael.kauzmann@colorado.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants