phetsims / plinko-probability

"Plinko Probability" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 7 forks source link

Translation of the statisticalPanel #16

Closed veillette closed 8 years ago

veillette commented 8 years ago

image

One issue is to find out how much of the statistics panel should be translatable. Right now, x bar, mu and sigma are hardwired. The "s" in s_mean is hardwired but 'mean' is translatable. 's' and 'n' are currently translatable.

  // strings
  var muGreekString = '\u03BC';
  var sigmaGreekString = '\u03C3';
  var xOverlineString = '\u0078\u0305';
  var meanString = require( 'string!PLINKO_PROBABILITY/mean' );
  var sMeanString = '\u0073<sub>' + meanString + '</sub>';
  var sString = require( 'string!PLINKO_PROBABILITY/s' );
  var nString = require( 'string!PLINKO_PROBABILITY/n' );
  var idealString = require( 'string!PLINKO_PROBABILITY/ideal' );
ariel-phet commented 8 years ago

@veillette all of those should be translatable. You will probably need to apply a rule whereby if the strings grow too large they scale down related to a max width of the panel. My guess is many translators will leave them as is, but we do want to allow the flexibility.

Denz1994 commented 8 years ago

The text in the statistics box is now translatable. Logic was also added to all of the text to scale the font size if a translation becomes lengthy.

Denz1994 commented 8 years ago

Test of elongated text, replicated by using "stringTest=double" in url.

image

This logic is followed in the slider control panel as well for consistency.

image

image

Additionally, the y-axis label of the histogram follows similar logic.

image

image

veillette commented 8 years ago

This will be deployed in the next dev version (1.0.0dev4).Closing