phetsims / number-suite-common

"Number Suite Common" contains code for use by sims that are part of the Number Suite
GNU General Public License v3.0
0 stars 0 forks source link

Buggy behavior when locale is not `en` #22

Closed zepumph closed 1 year ago

zepumph commented 1 year ago

I tried using the query parameters locale=es&secondLocale=en, and in unbuilt mode, this is buggy because the "primary strings" seem to be english only, perhaps that is because there aren't translations yet.

Then I tried building the sim, and with the same query parameters, running the all_debug html, I got this assertion:

Assertion failed: Text should be defined and non-null. Use the empty string if needed.

Hard to figure out the stack trace in the built version, but this seems to need to work. I'll investigate.

marlitas commented 1 year ago

I added a TODO for this in NumberSuiteCommonConstants, It seems like we're always assuming that the primary locale will be en in numberToWord. We need to add logic that eliminates that assumption.

@zepumph happy to look at this also, since I just did work in this area for https://github.com/phetsims/number-suite-common/issues/9. If that feels useful go ahead and assign me.

marlitas commented 1 year ago

We solved this by creating a number-common-strings folder in babel and adding all the translations there. Closing!