phetsims / blackbody-spectrum

"Blackbody Spectrum" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
1 stars 3 forks source link

RTL Labels do not break up spectrum #94

Closed KatieWoe closed 5 years ago

KatieWoe commented 5 years ago

Device Chadwick OS ChromeOS Browser 74.0.3729.159 Problem Description For https://github.com/phetsims/QA/issues/320 When stringTest=rtl, the labels of various parts of the spectrum do not show up. No tick marks appear when they should. Only one string shows up centered on the graph, no matter where the various spectrum bars are Steps to Reproduce

  1. stringTest=rtl
  2. Turn on labels
  3. Zoom x-axis in and out. Observe

Screenshots nolabels

DianaTavares commented 5 years ago

definitely a bug that have to be fix

arnabp commented 5 years ago

This is something that comes up if you do any stringtest that's not double, because the implementation for the labels depends on the names for the different wavelengths being different. Because most stringtests replace every string with the same word, the spectrum label combines all of them.

I don't, however, see this being a problem outside of testing purposes I believe? Translations should have different words for each type of light and if a language does happen to use the same name for, say, xray and ultraviolet, having the two sections combine would make sense.

arnabp commented 5 years ago

Discussed this with @jbphet and decided it was risky to use strings as keys in an Object. Moved away from that, which allows the label text to behave as expected. RTL, x, and any other stringtests will now break up the spectrum properly, closing.