phetsims / decaf

PhET Java Simulations converted to HTML5 using CheerpJ
1 stars 0 forks source link

Make it possible to launch multiple languages from the "all" JAR #6

Closed samreid closed 4 years ago

samreid commented 4 years ago

In https://github.com/phetsims/cheerpj/issues/2#issuecomment-606837121, @pixelzoom describes how to set the Java System properties to launch in a different locale. We should test this out.

samreid commented 4 years ago

By the following steps:

cd decaf/projects/faraday
java -Djavaws.user.languag"zh" -Djavaws.user.country="CN" -jar faraday_all.jar

The sim launches in zh_CN (after pressing "Start"):

image

In the CheerpJ HTML, I tried the following:

cheerpjInit({javaProperties:['javaws.user.language=zh','javaws.user.country=CN']});

and

it worked, but seems to be missing some glyphs:

image

I tried French and it worked great!

image

samreid commented 4 years ago

We should put the locale as a query parameter so that we only need 1 html file per project.

samreid commented 4 years ago

I'm seeing the same behavior (empty glyphs) in Safari and Firefox.

samreid commented 4 years ago

I added support for locale = language_COUNTRY in the URL and tested it with "fr" and "ku_TR" in Faraday's Law. It worked well in both cases. I'll close this and open a side issue about missing font glyphs.