From d03dbc156e8a7b0cae4e445c4cfebdb7c6deac85 Mon Sep 17 00:00:00 2001 From: Michael Kauzmann Date: Tue, 21 May 2024 11:10:41 -0600 Subject: [PATCH] assert messages, https://github.com/phetsims/chipper/issues/1441 Signed-off-by: Michael Kauzmann --- js/LocalizedString.ts | 2 +- js/getStringModule.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/LocalizedString.ts b/js/LocalizedString.ts index 570e3a957..168f58497 100644 --- a/js/LocalizedString.ts +++ b/js/LocalizedString.ts @@ -27,7 +27,7 @@ export type LocalizedStringStateDelta = Partial }; const localeData = phet.chipper.localeData; -assert && assert( localeData ); +assert && assert( localeData, 'localeData expected but global has not been set' ); class LocalizedString { diff --git a/js/getStringModule.ts b/js/getStringModule.ts index 4b1808d70..fc4f9a73b 100644 --- a/js/getStringModule.ts +++ b/js/getStringModule.ts @@ -105,7 +105,7 @@ const getStringModule = ( requirejsNamespace: string ): object => { // Our locale information is from phet.chipper.locale assert && assert( typeof phet.chipper.locale === 'string', 'phet.chipper.locale should have been loaded by now' ); - assert && assert( Object.keys( phet.chipper.localeData ).includes( phet.chipper.locale ), 'phet.chipper.locale should have been loaded by now' ); + assert && assert( Object.keys( phet.chipper.localeData ).includes( phet.chipper.locale ), `phet.chipper.locale:${phet.chipper.locale} is not in localeData` ); assert && assert( phet.chipper.strings, 'phet.chipper.strings should have been loaded by now' ); // Construct locales in increasing specificity, e.g. [ 'en', 'zh', 'zh_CN' ], so we get fallbacks in order