phetsims / vector-addition

“Vector Addition” is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 5 forks source link

Add support for dynamic layout #280

Closed pixelzoom closed 6 days ago

pixelzoom commented 2 weeks ago

I did the easy string Properties in https://github.com/phetsims/vector-addition/commit/ee2db85c1d82746920c5126219b78d7f6f06e905, and verified their behavior with ?stringTest=dynamic.

The remaining work is for these 2 strings, and involves changing sim-specific APIs.

  'symbol': {
    'x': string;
    'xStringProperty': LocalizedStringProperty;
    'y': string;
    'yStringProperty': LocalizedStringProperty;
  };
pixelzoom commented 1 week ago

Note that the vector symbols (a, b, c, d, e, f, s, v) are currently NOT translatable. That decision was made in https://github.com/phetsims/vector-addition/issues/10. But we may want to store them as string Properties and address their dynamic layout, so that it's easier to make them translatable in the future, if desired.

pixelzoom commented 1 week ago

In the above commits, I moved the remaining "symbol" strings (including the symbols that are not currently translatable) to VectorAdditionSymbols.ts, where they are all string Properties. Usage sites now need to be changed to update when these strings change.

pixelzoom commented 1 week ago

Dynamic locale support for axis symbols (x,y) is done. And while I was at it, I added future localization support for vector symbols (a,b,c,d,e,f,s,v).

Ready for verification in dev testing: https://github.com/phetsims/qa/issues/1163 and https://github.com/phetsims/qa/issues/1164.

Nancy-Salpepi commented 1 week ago

Looks good in https://github.com/phetsims/qa/issues/1163!

Nancy-Salpepi commented 6 days ago

Looks good in https://github.com/phetsims/qa/issues/1164 as well. Closing.