phetsims / joist

Joist is the main framework for PhET Interactive Simulations. Joist creates and displays the simulation content, home screen, navigation bar, About dialog, enables switching between tabs, and other framework-related features.
http://scenerystack.org/
MIT License
9 stars 6 forks source link

Update localeOrderProperty algorithm #869

Closed zepumph closed 2 years ago

zepumph commented 2 years ago

Over in https://github.com/phetsims/phet-io/issues/1893, the PhET-iO team (KP AR SR MK) decided that it would be better to have the following locale order:

  1. selected locale
  2. The "shortened" version of the selected, if available.
  3. The list specified by the fallbackLocalesProperty
  4. en

We will still keep the optimization here: https://github.com/phetsims/joist/blob/897250904e4e1343e219fd8d9f115b22f1c0a333/js/i18n/localeOrderProperty.ts#L39-L40

zepumph commented 2 years ago

Tagging @jonathanolson here because he and I came to a different agreement to the algorithm over in https://github.com/phetsims/chipper/issues/1302#issuecomment-1245515050.

@samreid, you will probably want to cherry-pick this for GAO, right?

samreid commented 2 years ago

https://github.com/phetsims/phet-io/issues/1893 is documented differently than I recall. I thought we concluded that PhET-iO would not automatically fall back to shortened locales. Is that implemented and I'm not seeing it? Or was that decision overturned?

zepumph commented 2 years ago

That issue documents the decision that was made. We decided not to automatically fall back onto shortened locales from custom fallbacks. Is that maybe what you were thinking of?

samreid commented 2 years ago

We decided not to automatically fall back onto shortened locales from custom fallbacks. Is that maybe what you were thinking of?

Yes, but it seems the implementation is still automatically falling back to the shortened one for the primary requested locale in https://github.com/phetsims/joist/blob/6500242a7ddcf1857f9bafda03fd958d73cfd600/js/i18n/localeOrderProperty.ts#L22-L26, unless I am misunderstanding something.

zepumph commented 2 years ago

Yes, that was specifically requested.

samreid commented 2 years ago

@samreid, you will probably want to cherry-pick this for GAO, right?

If I recall correctly, @kathy-phet recommended that we would take all new SHAs after recent changes?

zepumph commented 2 years ago

She said that we need these changes in GAO, and if it is more work than its worth to keep track of cherry picks, then we can do an rc

samreid commented 2 years ago

I opened a sim specific issue for cherry picking.