heldentodd / xray-diffraction

This repository contains the code for one simulation, but eventually three are planned: bragg-law, Single Crystal Diffraction, and Powder Diffraction.
GNU General Public License v3.0
1 stars 1 forks source link

'a', 'b', 'd' strings are not localized #5

Closed pixelzoom closed 4 years ago

pixelzoom commented 4 years ago

Related to #1 (code review).

  • [ ] Are there any strings that are not internationalized, and does the sim layout gracefully handle internationalized strings that are shorter than the English strings? (run with query parameter stringTest=X. You should see nothing but 'X' strings.)

The strings 'a' and 'b' are localized in the control panel, but not in CrystalNode.js. Here's what it looks like with stringTest=X:

screenshot_358

So if someone translates your sim to another language, there will be a problem here. Recommended to move string literals 'a', 'b', and 'd' from CrystalNode.js to xray-diffraction-strings_en.json.

heldentodd commented 4 years ago

This is fixed.

Originally, I thought a, b, and d would be universal abbreviations, but perhaps not, especially for d. I'm leaving sin(θ) and λ (for wavelength) hard coded because I really can't imagine those needing translation.

pixelzoom commented 4 years ago

Understood about 'a', 'b', 'd' possibly being universal abbreviations. I should have clarified that PhET sometimes makes a similar call with math symbols. And the problem here was that 'a' and 'b' were localized in one place (slider labels), but not in another (crystal).