Open pixelzoom opened 1 year ago
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.
Committed above. Here is the new order:
@samreid can you paste in the reference for why this is a reasonable sort?
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.
Thanks for committing https://github.com/phetsims/joist/commit/53c86e0e6b604cee615da2f5d4c5b95d10fda79c @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?
RE: https://github.com/phetsims/joist/commit/53c86e0e6b604cee615da2f5d4c5b95d10fda79c
This changed the PhET-iO API and required stable API validation. Now the localeProperty validValues is a different order.
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.