Skip to content
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

supportsDynamicLocale is automatically on if omitted from the package.json #1005

Open
zepumph opened this issue Jan 27, 2025 · 2 comments
Open

Comments

@zepumph
Copy link
Member

zepumph commented Jan 27, 2025

From dev meeting today. We want to have a good count of dynamic locale sims, but we can't trust the supportsDynamicLocale package flag as the number of repos that actually support this.

Here is the line we want to default to false if there is no package flag:

https://github.com/phetsims/chipper/blob/a3a64bfe631436dedcfe48944ee663e51ae02265/js/browser/initialize-globals.js#L349-L353

Here is @kathy-phet's list of sims that support dynamic locale:

https://phetsims.slack.com/archives/C05TB6YSP46/p1737384453597939?thread_ts=1737331294.737429&cid=C05TB6YSP46

There are 81 usages of "supportsDynamicLocale": true, this includes common code and test repos.

Acid Base Solutions (language)
Area Model Algebra (portrayals and language)
Area Model Decimals (language)
Area Model Introduction (language)
Area Model Multiplication (portrayals and language)
Arithmetic (portrayals and language)
Balancing Act (portrayals and language)
Balancing Chemical Equations (language)
Beer’s Law Lab (language)
Bending Light (language)
Build a Nucleus (language)
Buoyancy (language)
Buoyancy: Basics (language)
Calculus Grapher (language)
Center and Variability (portrayals and language)
Circuit Construction Kit DC (2 sims language)
Color Vision (language)
Concentration (language)
Density (language)
Energy Skate Park (portrayals and language)
Equality Explorer (3 sims language)
Faraday’s Electromagnetic Lab (4 sims language)
Forces and Motion: Basics (portrayals and language)
Fourier: Making Waves (language)
Friction (language)
Gas Properties (3 sims language)
Geometric Optics (language)
Geometric Optics: Basics (language)
Graphing Lines (portrayals and language)
Graphing Quadratics (language)
Graphing Slope-Intercept (portrayals and language)
Gravity and Orbits (language)
Greenhouse Effect (language)
Hooke’s Law (language)
Kepler’s Laws (language)
Least-Squares Regression (language)
Mean: Share and Balance (language)
Molecule Polarity (language)
Molecule Shapes (2 sims language)
My Solar System (language)
Natural Selection (language)
Number Compare (language)
Number Line: Distance (portrayals and language)
Number Line: Integers (portrayals and language)
Number Line: Operations (language)
Number Play (language)
pH Scale (language)
pH Scale: Basics (language)
Projectile Data Lab (language)
Projectile Sampling Distributions (language)
Quadrilateral (language)
Ratio and Proportion (language)
Reactants
Products
and Leftovers (language)
Sound Waves (language)
Unit Rates (language)
Vector Addition (2 sims language).
@zepumph zepumph self-assigned this Jan 27, 2025
@zepumph
Copy link
Member Author

zepumph commented Jan 27, 2025

With this script, I found this list of sims that need this flag added:

area-model-algebra !!!!!!!!
area-model-decimals !!!!!!!!
area-model-introduction !!!!!!!!
area-model-multiplication !!!!!!!!
buoyancy !!!!!!!!
energy-skate-park !!!!!!!!
friction !!!!!!!!
gravity-and-orbits !!!!!!!!
molecule-shapes !!!!!!!!
molecule-shapes-basics !!!!!!!!
my-solar-system !!!!!!!!
faradays-law !!!!!!!!
vector-addition !!!!!!!!
import * as fs from 'node:fs';
import execute from '../perennial/js/common/execute.js';
import gruntCommand from '../perennial/js/common/gruntCommand.js';

const x = [ 'acid-base-solutions',
  'area-model-algebra',
  'area-model-decimals',
  'area-model-introduction',
  'area-model-multiplication',
  'arithmetic',
  'balancing-act',
  'balancing-chemical-equations',
  'beers-law-lab',
  'bending-light',
  'build-a-nucleus',
  'buoyancy',
  'buoyancy-basics',
  'calculus-grapher',
  'center-and-variability',
  'circuit-construction-kit-dc',
  'circuit-construction-kit-dc-virtual-lab',
  'color-vision',
  'concentration',
  'density',
  'energy-skate-park',
  'forces-and-motion-basics',
  'fourier-making-waves',
  'friction',
  'geometric-optics',
  'geometric-optics-basics',
  'graphing-lines',
  'graphing-quadratics',
  'graphing-slope-intercept',
  'gravity-and-orbits',
  'greenhouse-effect',
  'hookes-law',
  'keplers-laws',
  'least-squares-regression',
  'mean-share-and-balance',
  'molecule-polarity',
  'molecule-shapes',
  'molecule-shapes-basics',
  'my-solar-system',
  'natural-selection',
  'number-compare',
  'number-line-distance',
  'number-line-integers',
  'number-line-operations',
  'number-play',
  'ph-scale',
  'ph-scale-basics',
  'projectile-data-lab',
  'projectile-sampling-distributions',
  'quadrilateral',
  'ratio-and-proportion',
  'reactants-products-and-leftovers',
  'sound-waves',
  'unit-rates',
  'equality-explorer',
  'equality-explorer-basics',
  'equality-explorer-two-variables',
  'faradays-electromagnetic-lab',
  'faradays-law',
  'generator',
  'magnet-and-compass',
  'magnets-and-electromagnets',
  'diffusion',
  'gas-properties',
  'gases-intro',
  'vector-addition-equations',
  'vector-addition' ];

const problems = [];
for ( const sim of x ) {
  const packageJSON = JSON.parse( fs.readFileSync( `../${sim}/package.json`, 'utf-8' ) );

  if ( !packageJSON.phet?.simFeatures?.supportsDynamicLocale ) {
    problems.push( sim );
  }
}
console.log( JSON.stringify( problems ) );


// const prob = [ 'area-model-algebra',
//   'area-model-decimals',
//   'area-model-introduction',
//   'area-model-multiplication',
//   'buoyancy',
//   'energy-skate-park',
//   'friction',
//   'molecule-shapes',
//   'molecule-shapes-basics',
//   'my-solar-system',
//   'faradays-law',
//   'vector-addition',
//   'gravity-and-orbits' ];
const prob = problems;

( async () => {
  for ( const repo of prob ) {
    console.log( repo );
    await execute( gruntCommand, [ 'update' ], `../${repo}` );
  }
} )();

zepumph added a commit to phetsims/area-model-algebra that referenced this issue Jan 27, 2025
zepumph added a commit to phetsims/area-model-introduction that referenced this issue Jan 27, 2025
zepumph added a commit to phetsims/molecule-shapes-basics that referenced this issue Jan 27, 2025
zepumph added a commit to phetsims/molecule-shapes that referenced this issue Jan 27, 2025
zepumph added a commit to phetsims/energy-skate-park that referenced this issue Jan 27, 2025
zepumph added a commit to phetsims/vector-addition that referenced this issue Jan 27, 2025
zepumph added a commit to phetsims/buoyancy that referenced this issue Jan 27, 2025
zepumph added a commit to phetsims/friction that referenced this issue Jan 27, 2025
zepumph added a commit to phetsims/chipper that referenced this issue Jan 27, 2025
zepumph added a commit to phetsims/area-model-multiplication that referenced this issue Jan 27, 2025
zepumph added a commit to phetsims/my-solar-system that referenced this issue Jan 27, 2025
zepumph added a commit to phetsims/area-model-decimals that referenced this issue Jan 27, 2025
zepumph added a commit to phetsims/gravity-and-orbits that referenced this issue Jan 27, 2025
zepumph added a commit to phetsims/faradays-law that referenced this issue Jan 27, 2025
@zepumph
Copy link
Member Author

zepumph commented Jan 27, 2025

Alright. Updates have been committed based on the list from slack. I believe the next step here is to have some sort of QA step where we make sure that we didn't miss any sims that we want to be marked as supportsDynamicLocale:true. Anyone can check if we have marked a sim correctly with a URL like this:

https://github.com/phetsims/gravity-and-orbits/blob/main/package.json

Here is the current list of repos that have package.json marking them with "supportsDynamicLocale": true. I'm going to assign @marlitas to review the code change as well as coordinate with @kathy-phet and or QA about next steps. Thanks!

acid-base-solutions
area-model-algebra
area-model-decimals
area-model-introduction
area-model-multiplication
arithmetic
balancing-act
balancing-chemical-equations
bamboo
beers-law-lab
bending-light
build-a-nucleus
buoyancy
buoyancy-basics
calculus-grapher
center-and-variability
chains
circuit-construction-kit-common
circuit-construction-kit-dc
circuit-construction-kit-dc-virtual-lab
color-vision
concentration
density
density-buoyancy-common
description-demo
diffusion
energy-skate-park
equality-explorer
equality-explorer-basics
equality-explorer-two-variables
example-sim
faradays-electromagnetic-lab
faradays-law
forces-and-motion-basics
fourier-making-waves
friction
function-builder-basics
gas-properties
gases-intro
generator
geometric-optics
geometric-optics-basics
graphing-lines
graphing-quadratics
graphing-slope-intercept
gravity-and-orbits
greenhouse-effect
hookes-law
joist
keplers-laws
least-squares-regression
magnet-and-compass
magnets-and-electromagnets
mean-share-and-balance
membrane-channels
mobius
models-of-the-hydrogen-atom
molecule-polarity
molecule-shapes
molecule-shapes-basics
my-solar-system
natural-selection
nitroglycerin
number-compare
number-line-common
number-line-distance
number-line-integers
number-line-operations
number-pairs
number-play
number-suite-common
ph-scale
ph-scale-basics
projectile-data-lab
projectile-sampling-distributions
quadrilateral
quantum-measurement
ratio-and-proportion
reactants-products-and-leftovers
scenery-phet
simula-rasa
soccer-common
sound-waves
sun
tambo
tangible
tappi
testing-sim
twixt
unit-rates
vector-addition
vector-addition-equations
vegas
wilder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants