phetsims/build-an-atom

Spanish "es" translation of Build an Atom is not opening (the sim open in English)

Closed this issue · 12 comments

If you go to the Spanish website: https://phet.colorado.edu/es/simulations/build-an-atom and click in the simulation, it is going to open it in English: https://phet.colorado.edu/sims/html/build-an-atom/latest/build-an-atom_all.html?locale=es

But the strings are translated in the translation tool:
image

Looks like the problem is with the locale=es because with the other link, the sim open normal: https://phet.colorado.edu/sims/html/build-an-atom/latest/build-an-atom_es.html

@jonathanolson can you take a look to start?

I wonder if this is related to new locale work, currently being reviewed in phetsims/chipper#1441

On it.

I think this might be cleanest to build simulations with --locales=* instead of only building specific locales. In discussion with @mattpen and @zepumph about it. If not:

build-an-atom 1.6 specific patch to fix:

Subject: [PATCH] fix patch
---
Index: js/grunt/getBuildConfig.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/getBuildConfig.js b/js/grunt/getBuildConfig.js
--- a/js/grunt/getBuildConfig.js	(revision 38f062b444c0bb7f75aada161b706d573f929274)
+++ b/js/grunt/getBuildConfig.js	(date 1720460658380)
@@ -347,6 +347,7 @@
 
   buildConfig.licenseKeys = getLicenseKeys( packageJSON, buildJSON, buildConfig.brand, buildConfig.preload );
   buildConfig.locales = getLocales( grunt, buildConfig.name );
+  buildConfig.allLocales = getLocalesFromRepository( buildConfig.name );
   buildConfig.availableLocales = [ ChipperConstants.FALLBACK_LOCALE ].concat( getLocalesFromRepository( buildConfig.name ) );
 
   grunt.log.debug( 'buildConfig=' + JSON.stringify( buildConfig, null, 2 ) );
Index: js/grunt/createHTMLFiles.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/grunt/createHTMLFiles.js b/js/grunt/createHTMLFiles.js
--- a/js/grunt/createHTMLFiles.js	(revision 38f062b444c0bb7f75aada161b706d573f929274)
+++ b/js/grunt/createHTMLFiles.js	(date 1720460695382)
@@ -229,13 +229,13 @@
     // Always include the fallback (en)
     var includedDataLocales = [ ChipperConstants.FALLBACK_LOCALE ];
     // Include directly-used locales
-    buildConfig.locales.forEach( function( locale ) {
+    buildConfig.allLocales.forEach( function( locale ) {
       includedDataLocales.push( locale );
     } );
     // Include locales that will fall back to directly-used locales
     Object.keys( fullLocaleData ).forEach( function( locale ) {
       if ( fullLocaleData[ locale ].fallbackLocales && fullLocaleData[ locale ].fallbackLocales.some( function( fallbackLocale ) {
-        return buildConfig.locales.includes( fallbackLocale );
+        return buildConfig.allLocales.includes( fallbackLocale );
       } ) ) {
         includedDataLocales.push( locale );
       }

Deploys are going out. I'll check this later or tomorrow.

Deploys should be complete. @DianaTavares can you verify?

I'm still going to the PhET website ins Spanish and the sim open in English:

image

that happen in my cellphone and computer, do I need to do something special?

I believe this will be cached until tomorrow.

I checked and the uncached copy is showing the same thing.

To see an uncached copy, change the subdomain to phet-origin and add a random query parameter (e.g. nonce=something)

https://phet-origin.colorado.edu/sims/html/build-an-atom/latest/build-an-atom_all.html?locales=es&nonce=4398ty3489

Thanks for the reminder @mattpen, I always forget. I believe the test is locale=es, singular. When I do that everything is working well!

https://phet-origin.colorado.edu/sims/html/build-an-atom/latest/build-an-atom_all.html?locale=es&nonce=4398ty3489fds

@DianaTavares can you confirm.

It is working!!
Can I close this issue?

Thanks so much @jonathanolson and @mattpen for the quick work here.