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.
MIT License
8 stars 6 forks source link

support dynamic locale switching in preferences panels #851

Closed zepumph closed 1 year ago

zepumph commented 1 year ago

this is blocking friction phet-io release.

zepumph commented 1 year ago

I'll do this. I hit it while reviewing https://github.com/phetsims/joist/issues/838.

zepumph commented 1 year ago

This should be all supported. I was able to test in the input and audio panels, but voicing isn't working because of https://github.com/phetsims/joist/issues/852. Please review once that issue is complete.

zepumph commented 1 year ago

Oh sorry! This isn't actually working. PreferencesToggleSwitch is not supportive of relayout. I'm not sure how best to support this. here is how it currently looks:

image

samreid commented 1 year ago

CTQ says:

tsc: ../../../joist/js/preferences/VoicingPanelSection.ts(286,9): error TS2322: Type 'TReadOnlyProperty' is not assignable to type 'ResolvedResponse | undefined'.

I'll commit a ts-ignore so this doesn't disrupt our precommit hooks.

zepumph commented 1 year ago

Sorry. My push had a conflict. All should be good now.

jessegreenberg commented 1 year ago

Thanks @zepumph commits above look good. Ill take a look at PreferencesToggleSwitch. PreferencesToggleSwitch uses static relative manual layout for each combination of components it can include. This seems like a great place to try some new dynamic scenery layout support

jessegreenberg commented 1 year ago

With help from @jonathanolson I implemented layout for PreferencesToggleSwitch using GridBox. I found a couple of strings in VisualPreferencesPanel that were not using Properties. And I removed some documentation about excluding some strings from i18n since they will be translatable now.

I think that is all for Preferences contents except for https://github.com/phetsims/joist/issues/852 and we will continue there. Closing.