-
Notifications
You must be signed in to change notification settings - Fork 6
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
Image localization and regionAndCulture #953
Comments
Initial implementation above (on main). I've added a stub that will hook into any regionAndCulturePortrayalProperty (so that it is kept in-sync with the regionAndCultureProperty that was added). Presumably after things are ported over, we won't need that other Property. I made the decision to only instrument the main regionAndCultureProperty if it has multiple valid values (will be defined/featured similarly to regionAndCulturePortrayalProperty). Right now it is a fairly independent system from the current portrayal system. Demo in wilder. |
I'll review and refine soon with @pixelzoom. @marlitas I'd be curious to get your opinion on the above commits as well (and whether you have any concerns or misgivings about them). |
I'm glad I re-read this because the bidirectional link between regionAndCulturePortrayalProperty and regionAndCultureProperty was very concerning. I am adding a TODO referencing this issue (can be moved elsewhere if needed) so that we don't forget to adjust. I was also curious about the change set in - validValues: packageSimFeatures.supportedRegionsAndCultures || [ null ],
- defaultValue: packageSimFeatures.supportedRegionsAndCultures?.[ 0 ] ?
packageSimFeatures.supportedRegionsAndCultures[ 0 ] : null
+ defaultValue: 'usa'
|
…tureComboBox directly into the new regionAndCulture Property system. Added multi support. See phetsims/joist#953
…tureComboBox directly into the new regionAndCulture Property system. Added multi support. See phetsims/joist#953
…tureComboBox directly into the new regionAndCulture Property system. Added multi support. See #953
… comments that broke the build. See phetsims/joist#953
… comments that broke the build. See phetsims/joist#953
… comments that broke the build. See #953
… comments that broke the build. See phetsims/joist#953
… comments that broke the build. See phetsims/joist#953
@jonathanolson and I paired on this for 1.75 hours this morning, commits above. I'll review joist/js/i18n/ and start transitioning graphing-lines. |
…t, and adding locale-specific sort, see #953
…ave ImageProperty suffix, phetsims/joist#953
…ave ImageProperty suffix, phetsims/joist#953
In phetsims/graphing-lines#143, I moved graphing-lines and graphing-slope-intercept to the new common code. Here's a list of the things that I ran into.
@jonathanolson let's discuss 3, 4, 5, and 6. |
I addressed this in fcddee0. The Localization tab appears in Preferences if its appropriate to show either |
Renaming of image files is done, with the exception of soccer-common. The 'usa' images for soccer-common have a problem (see phetsims/soccer-common#13) so I'll need to circle back to rename those files. I followed convoluted path to get to the final naming convention. Putting all files in images/localization/ turned out to have some problems:
So I ended up leaving files in a directory per region: images/africa/, images/africaModest, images/asia, etc. These seems fine, and serves the same purpose as the proposed localized/ directory - to differentiate between localized and non-localized images. |
Here's the bash script that I used to rename image files. I fixed up license.json and RegionAndCulturePortrayal subclasses using global string replacement in WebStorm. #!/bin/bash
# First command line argument is the prefix to be added to each file.
PREFIX=${1}
# Allow patterns that match no files, so we can iterate over both .png and .svg
shopt -s nullglob
for filename in *.{png,svg}; do
# Convert the first character of the filename to upper case.
UPPER=`echo ${filename} | awk '{ print toupper( substr( $0, 1, 1 ) ) substr( $0, 2 ); }'`
# Add the prefix.
NEW_FILENAME=${PREFIX}${UPPER}
# Rename the file, preserving git history.
git mv ${filename} ${NEW_FILENAME}
done |
Remaining work:
|
All sims have been converted to the new approach. So I removed the old implementation from common code in the above commits. There are references to |
The last bit of cleanup (getOverridingQueryParameters.ts) will be handled by @zepumph in https://github.com/phetsims/phet-io-wrappers/issues/637. So closing this issue. |
Issue for tracking commits and review. Implementing @pixelzoom's vision for regionAndCulture.
The text was updated successfully, but these errors were encountered: