phetsims / expression-exchange

"Expression Exchange" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 2 forks source link

issues with symbols (x, y, z) #17

Open pixelzoom opened 8 years ago

pixelzoom commented 8 years ago

While working on function-builder, I was asked to "use the mathematical script symbols for x & y, as in Expression Exchange". Looking at Expression Exchange, I noted these potential issues:

(1) The symbols x, y and z are not localized. They do not appear in expression-exchange-strings_en.json, and are in fact literals in the code. Eg in ExpressionManiplationView:

new Text( 'x', { font: new PhetFont( { family: '"Times New Roman", serif', size: 32, style: 'italic' } ) } )

In Skype, @jbphet said:

localization was discussed and, like other formulas, we decide at least for now not to allow them to be translated.

This decision has been the opposite in every math sim that I've worked on.

(2) The literal 'x' is duplicated in 2 places: ExpressionManiplationView, CoinTerm. If symbols aren't going to be localized, then they should at least be specified in one place.

(3) The sim isn't using the mathematical script symbols (as defined in Unicode), but are instead using Roman characters and a script font (as in ExpressionManiplationView above).

Assigning to @jbphet to determine which (if any) of these need to be addressed.

pixelzoom commented 8 years ago

Unicode for "mathematical script small"

x: http://www.fileformat.info/info/unicode/char/1d4cd/index.htm y: http://www.fileformat.info/info/unicode/char/1d4ce/index.htm z: http://www.fileformat.info/info/unicode/char/1d4cf/index.htm

Unicode for "mathematical italic small"

x: http://www.fileformat.info/info/unicode/char/1d465/index.htm y: http://www.fileformat.info/info/unicode/char/1d466/index.htm z: http://www.fileformat.info/info/unicode/char/1d467/index.htm

In Function Builder, "script" was requested. But I'm not sure if anyone really knew what that looks like.

pixelzoom commented 8 years ago

The consensus for function-builder was that the "mathematical italic small" versions of these symbols were the look they wanted.

jbphet commented 8 years ago

This issue was discussed in the 5/5/2016 design meeting, the outcome was:

  1. use the unicode symbols the @pixelzoom arrived at in function builder
  2. defer on whether or not to localize the symbols until later in the development process, probably around August of this year
pixelzoom commented 8 years ago

FYI, https://github.com/phetsims/scenery/issues/545#issuecomment-220116510:

We're going with built-in font, which has been encapsulate in scenery-phet.MathSymbolFont, for use by function-builder and expression-exchange.

jbphet commented 8 years ago

At this point in the development, we are using the MathSymbolFont, and it is working well. I'm going to unassign this issue and we will decide when the sim gets closer to publication whether the symbols used in the equations should be translatable.

jbphet commented 7 years ago

Assigning to @amanda-phet to see if we can make a call on this. It seems like the current font is working well, and in my opinion it would be tricky to support translatable variables and I'd prefer not to do that unless we deem it absolutely necessary.

amanda-phet commented 7 years ago

The current font is working and since it is the same one that is used in Function Builder, I think we can tackle the translation issue separately (if we still want to at all- I don't see a reason to but I am also not well-versed in international math conventions).

pixelzoom commented 6 years ago

Reopening as the result of a related discussion with @amanda-phet.

Regardless of whether 'x' and 'y' are translated, they should not be copied N times in the code. There are currently 12 occurrences of 'x' and 9 occurrences of 'y'. Factor out constants.