phetsims / resistance-in-a-wire

"Resistance in a Wire" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/resistance-in-a-wire
GNU General Public License v3.0
1 stars 4 forks source link

Translations not being displayed #17

Closed samreid closed 11 years ago

samreid commented 11 years ago

When navigating to the sim with a query parameter like ?locale=fr, the English translation is still being shown.

samreid commented 11 years ago

I discovered that the resistance-in-a-wire-strings.js was missing entries for the available language packages. I'll add that shortly.

samreid commented 11 years ago

There is another unrelated problem which is still causing the strings to not load in some circumstances. It seems to be a problem when including the same strings file from different relative paths. For instance, in some places it is loaded as:

require( 'i18n!../nls/resistance-in-a-wire-strings' )

but in some places it is loaded as

require( "i18n!../../../nls/resistance-in-a-wire-strings" )

Sam Breed & I ran into a similar problem while we were working on https://github.com/phetsims/phetcommon/issues/2

Perhaps the best solution would be to load the strings in only one place as a requirejs object, then have clients load that requirejs object through the standard requirejs interface (not through the i18n! interface).

samreid commented 11 years ago

I committed a fix for the 2nd problem and now the strings are being loaded properly when using non-minified code during development time. I haven't tried it after grunt minification yet.

samreid commented 11 years ago

Reassigning to @jbphet for testing and discussion.

phetsims commented 11 years ago

Looks good to me. Closing.