From 5a88944ec30a82eea8232a6baec2741aec39ea06 Mon Sep 17 00:00:00 2001 From: Jonathan Olson Date: Tue, 22 Oct 2019 12:23:30 -0600 Subject: [PATCH] Properly handle building of sims with any locale, even one without sim-specific or any strings for that locale. See https://github.com/phetsims/perennial/issues/83 --- js/grunt/buildRunnable.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/grunt/buildRunnable.js b/js/grunt/buildRunnable.js index f67539396..38c37faa9 100644 --- a/js/grunt/buildRunnable.js +++ b/js/grunt/buildRunnable.js @@ -101,6 +101,14 @@ module.exports = async function( repo, minifyOptions, instrument, allHTML, brand const thirdPartyEntries = getAllThirdPartyEntries( repo, brand ); const stringMap = getStringMap( allLocales, phetLibs ); + // If we have NO strings for a given locale that we want, we'll need to fill it in with all English strings, see + // https://github.com/phetsims/perennial/issues/83 + for ( const locale of locales ) { + if ( !stringMap[ locale ] ) { + stringMap[ locale ] = stringMap[ ChipperConstants.FALLBACK_LOCALE ]; + } + } + const simTitleStringKey = getTitleStringKey( repo ); const englishTitle = stringMap[ ChipperConstants.FALLBACK_LOCALE ][ simTitleStringKey ]; assert( englishTitle, `missing entry for sim title, key = ${simTitleStringKey}` );