-
Notifications
You must be signed in to change notification settings - Fork 14
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
Find a better way to get translated screen names for the website #1367
Comments
Even if this is all we could provide to the build-server, it would be pretty simple to fetch these from babel - much more efficient than running puppeteer to scrape the screen names from joist at runtime. Also, if this proves difficult, one other option is for the website to do this asyncrounously whenever it generates the other file related content for the metadata (currently scheduled once/day). This would accomplish the goal of speeding the builds up anyway. |
This would allow us to NOT run puppeteer to grab the screen names out of sims, AND would be fairly feasible to patch for older simulations AND master. THIS would allow us to remove puppeteer usage from build-server, which would make it much more robust and faster (although phet-io brand builds will still run puppeteer). This would knock off at least 8 hours from a full production deployment of all release branches. I'll need to talk to other devs about this, but here's my proposal: We include an array of screen name string keys in the package.json, e.g. in area-model-algebra's package.json:
This would only be done for multi-screen sims (would not exist for single-screen sims). This can be generated for most older sims by running puppeteer and filtering keys with something like: const likelyKeys = Object.keys( phet.chipper.strings.en ).filter( str => str.includes( 'creen' ) && !str.includes( 'JOIST' ) && !str.includes( 'SCENERY_PHET' ) );
_.find( likelyKeys, key => phet.chipper.strings.en[ key ] === phet.joist.sim.screens[ 1 ].nameProperty.value ) Additionally, on master, we can add code to make sure this doesn't get out-of-sync. It's possible to tag the stringProperties with a |
I'll also add assertions in Screen to make sure that the key provided is in the package.json, so it doesn't get out-of-sync. |
…ings to some runnables), see phetsims/chipper#1367
…ings to some runnables), see phetsims/chipper#1367
…ings to some runnables), see phetsims/chipper#1367
…ings to some runnables), see phetsims/chipper#1367
…ings to some runnables), see phetsims/chipper#1367
…ings to some runnables), see phetsims/chipper#1367
…ings to some runnables), see phetsims/chipper#1367
…ings to some runnables), see phetsims/chipper#1367
…ings to some runnables), see phetsims/chipper#1367
…ings to some runnables), see phetsims/chipper#1367
…ings to some runnables), see phetsims/chipper#1367
…ings to some runnables), see phetsims/chipper#1367
…ings to some runnables), see phetsims/chipper#1367
…ings to some runnables), see phetsims/chipper#1367
…ings to some runnables), see phetsims/chipper#1367
…ings to some runnables), see phetsims/chipper#1367
…ings to some runnables), see phetsims/chipper#1367
Production links, I'll test: acid-base-solutions 1.2 () area-builder 1.1 () area-model-algebra 1.2 () area-model-decimals 1.2 () area-model-introduction 1.2 () area-model-multiplication 1.2 () arithmetic 1.0 () atomic-interactions 1.2 () balancing-act 1.1 () balancing-chemical-equations 1.2 () balloons-and-static-electricity 1.3-phetio ()
balloons-and-static-electricity 1.5 () beers-law-lab 1.7 () bending-light 1.1 () blackbody-spectrum 1.0 () build-a-fraction 1.0 () build-a-molecule 1.0 () build-a-nucleus 1.0 () build-an-atom 1.5-phetio () build-an-atom 1.6 () calculus-grapher 1.0 () capacitor-lab-basics 1.6 ()
center-and-variability 1.0 ()
charges-and-fields 1.0 () charges-and-fields 1.0-phetio () circuit-construction-kit-ac 1.0 () circuit-construction-kit-ac-virtual-lab 1.0 () circuit-construction-kit-dc 1.3 ()
circuit-construction-kit-dc-virtual-lab 1.3 ()
collision-lab 1.1 () color-vision 1.1 () color-vision 1.2-phetio () concentration 1.5-phetio () concentration 1.7 () coulombs-law 1.0 () curve-fitting 1.0 () density 1.0 () diffusion 1.0 () energy-forms-and-changes 1.4 ()
energy-skate-park 1.2 () energy-skate-park-basics 1.1 () energy-skate-park-basics 1.3-phetio () equality-explorer 1.1 () equality-explorer-basics 1.0 () equality-explorer-two-variables 1.0 () expression-exchange 1.1 () faradays-law 1.3-phetio () faradays-law 1.4 () forces-and-motion-basics 2.1-phetio () forces-and-motion-basics 2.3 () fourier-making-waves 1.0 () fraction-matcher 1.2 () fractions-equality 1.1 () fractions-intro 1.0 () fractions-mixed-numbers 1.0 () friction 1.6 () function-builder 1.2 () function-builder-basics 1.2 () gas-properties 1.0 () gases-intro 1.0 () gene-expression-essentials 1.0 () geometric-optics 1.1 () geometric-optics-basics 1.2 () graphing-lines 1.3 () graphing-quadratics 1.2 ()
graphing-slope-intercept 1.1 () gravity-and-orbits 1.5 () gravity-and-orbits 1.6 ()
gravity-force-lab 2.2 () gravity-force-lab-basics 1.1 () greenhouse-effect 1.0 () greenhouse-effect 1.1 () hookes-law 1.0 () isotopes-and-atomic-mass 1.1 () john-travoltage 1.4-phetio () john-travoltage 1.6 () least-squares-regression 1.1 () make-a-ten 1.0 () masses-and-springs 1.0 () masses-and-springs-basics 1.0 () mean-share-and-balance 1.0 () molarity 1.4 () molarity 1.5 () molecule-polarity 1.2 () molecule-shapes 1.6 () molecule-shapes-basics 1.6 ()
molecules-and-light 1.3-phetio () molecules-and-light 1.5 () my-solar-system 1.0 () natural-selection 1.2 () natural-selection 1.3 () natural-selection 1.4 () neuron 1.1 () normal-modes 1.0 () number-compare 1.0 () number-line-distance 1.0 () number-line-integers 1.1 () number-line-operations 1.0 () number-play 1.1 () ohms-law 1.4 () pendulum-lab 1.0 () ph-scale 1.5 () ph-scale 1.6 () ph-scale-basics 1.5 () ph-scale-basics 1.6 () phet-io-test-sim 2.12 () plinko-probability 1.1 () projectile-motion 1.0 () proportion-playground 1.0 () ratio-and-proportion 1.2 () reactants-products-and-leftovers 1.2 () resistance-in-a-wire 1.3-phetio () resistance-in-a-wire 1.6 () rutherford-scattering 1.1 () states-of-matter 1.2 () states-of-matter-basics 1.2 ()
trig-tour 1.0 () under-pressure 1.1 () unit-rates 1.0 () vector-addition 1.0 () vector-addition-equations 1.0 () wave-interference 2.0 () wave-on-a-string 1.1 () waves-intro 1.1 () |
Verified that all production releases completed successfully. |
@jonathanolson and I successfully adapted the build-server today to use the translated screen names based on the sim's package.json and the relevant babel files. I confirmed that this is working as expected with a production deploy of example-sim v1.2. This reduced the amount of time needed for screen names from 3-5 minutes to less than 1 second! @jonathanolson - is there anything else to do here? |
Nothing else to do, closing! |
It sounds like it's taking 7 minutes to parse out the screen names right now (but running the simulation for every locale). This seems inefficient, perhaps we can generate these during the simulation build quickly (especially if sims report out what their string keys are for the screens).
The text was updated successfully, but these errors were encountered: