phetsims / forces-and-motion-basics

"Forces and Motion: Basics" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/forces-and-motion-basics
GNU General Public License v3.0
7 stars 10 forks source link

Add dynamic locale #309

Open Luisav1 opened 4 months ago

Luisav1 commented 4 months ago

All string properties are present, need to implement the necessary changes so the view updates whenever these string properties change.

Luisav1 commented 4 months ago

@amanda-phet Dynamic locale is done and ready for a quick review!

amanda-phet commented 4 months ago

A few things I'm wondering about after trying out stringTest=dynamic

I think the green panels should be right-aligned, and in the case of a long string the panel got wider in the right direction, and I think it should get wider in the left direction.

Screenshot 2024-04-30 at 8 39 34 PM

I noticed the friction slider moved around a bit with different string lengths, and I'm not sure if that's desired or not. It seems to me that the slider should always be centered.

Here is the original and a long string looking expected:

image image

These two sliders are wider, specifically with the right end getting closer to the edge of the panel:

image image

The icons in the green panel on the 4th screen need to be right-aligned with the panel, not the strings:

image
Luisav1 commented 3 months ago

I right-aligned the green panel in the Net Force screen though the panels in the other screens aren't resizable, it is the strings that change length. Did we want to right-align the string + icon combo in the other screens? Because I found it looks a bit too left edge when that happens: image So in a commit above right now the string + icon combo is centered in the panel when the strings get long, which pushes the icon more to the right and the checkbox + string more to the left: image But we could also simply set a constant width and not allow the string + icon combo to expand such that the checkbox and icon stay in the same position despite the strings changing length. @amanda-phet what are your thoughts?

Right, the friction slider did move around. I now set it to be sizable: false so it doesn't change size or move when strings change.

With the way the control panels are created, the icons appear to be right-aligned on the other screens so I added that to the 4th screen too to match the other screens.