-
Notifications
You must be signed in to change notification settings - Fork 5
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
Instrument or Remove Dynamic Locale #372
Comments
In addition, most of the strings in the sim are not translated when switching locale dynamically. |
Dynamic strings/locale is not within the scope of this release, so I think we should hide the Preferences dialog. |
I looked into whether it is possible to just turn off the preferences dialog for the "all" version of the sim, which is what we publish on the main site nowadays. It doesn't seem like it is. I was looking at this commit, and from a cursory analysis, it appears to set
Based on all of this, I don't think there is currently an easy way to turn off locale switching. I will discuss with the rest of the dev group whether we want to add such an option or require support for dynamic strings in all publications off of master. |
Hey there, I just noticed this thread go by. PreferencesModel has this option to disable dynamic locales for the sim, see https://github.com/phetsims/energy-skate-park/blob/044dc7a98ff33aef0270f91f7dafed092dc0c43d/js/energy-skate-park-main.js#L44-L47 |
Thank you @jessegreenberg! I just tried adding the following to the sim options and indeed, the preferences menu option disappears from the nav bar: preferencesModel: new PreferencesModel( {
localizationOptions: {
supportsDynamicLocales: false
}
} ) I'll also add an agenda item to the next dev meeting to make sure other developers are aware of this and on board with using it. |
We reviewed this in today's dev meeting. We agree we can't always take the time to make all strings dynamic. So using this option to shut off the localization part of the preferences seems good. MK: During RAP, I felt like we had to add the dynamic locales--did not really know there was an opt-out option. So we just went for it and it turned out ok. Opt-out is great though and we can determine that by priority on a case by case basis. UPDATE: We saw that package.json has @zepumph would like to take a first look though. @zepumph will invite @jessegreenberg as appropriate. Will need defaults, and support for opt-in opt-out and query parameters, etc. |
And let's also note the built side of things: |
…ms/masses-and-springs#372 - rename from plural to singular for consistency, - update documentation - opt out via package.json instead of PreferencesModel
…ms/masses-and-springs#372 - rename from plural to singular for consistency, - update documentation - opt out via package.json instead of PreferencesModel
…ms/masses-and-springs#372 - rename from plural to singular for consistency, - update documentation - opt out via package.json instead of PreferencesModel
…ms/masses-and-springs#372 - rename from plural to singular for consistency, - update documentation - opt out via package.json instead of PreferencesModel
- rename from plural to singular for consistency, - update documentation - opt out via package.json instead of PreferencesModel
I worked with @jessegreenberg to make sure that this is still an 'opt out' default, but that the package string still supports strict mode. I am really happy with this behavior. We were able to remove the redundant usages of specific calls to opt out of the preferences locale switcher. That is now controlled by the package.json flag. In built versions, I was also glad to see that In http://localhost:8080/masses-and-springs-basics/build/phet/masses-and-springs-basics_en_phet.html?debugger&locales=*&supportsDynamicLocale=true it still won't show the locale switcher because we only support english (and the build process passed that flag through. In http://localhost:8080/energy-skate-park/build/phet/energy-skate-park_all_phet_debug.html we by default don't show the switcher, because we opted out in the package.json flag, but if you add @jessegreenberg can you please spot check and let me know if you have any other steps here. |
…ms/masses-and-springs#372 - rename from plural to singular for consistency, - update documentation - opt out via package.json instead of PreferencesModel
…ms/masses-and-springs#372 - rename from plural to singular for consistency, - update documentation - opt out via package.json instead of PreferencesModel
…ng property on the global, phetsims/masses-and-springs#372
CT found one issue in scenery sandbox pages, phetsims/chipper@8232add |
Looks good @zepumph, thanks for taking this on. I appreciate the rename (dynamicLocales -> dynamicLocale) for consistency. I did a bit of testing for the logic in a built sim, combinations behaved as I expected. Thank you! |
Test device
MacBook Air M1 chip
Operating System
13.3.1
Browser
Safari
Problem description
For phetsims/qa#936, dynamic locale hasn't been instrumented. Should it be part of this current dev version or should the preferences dialog be removed?
Currently, when I switch locales from the Preferences menu, longer translations cause the Reset All button to move partially/completely offscreen. Also, with stringTest=dynamic, none of the words in the panels change.
The text was updated successfully, but these errors were encountered: