Skip to content

Commit

Permalink
assert messages, #1441
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Kauzmann <[email protected]>
  • Loading branch information
zepumph committed May 21, 2024
1 parent 9f18c9e commit d03dbc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/LocalizedString.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export type LocalizedStringStateDelta = Partial<Record<Locale, TranslationString
export type StringsStateStateObject = { data: Record<PhetioID, LocalizedStringStateDelta> };

const localeData = phet.chipper.localeData;
assert && assert( localeData );
assert && assert( localeData, 'localeData expected but global has not been set' );

class LocalizedString {

Expand Down
2 changes: 1 addition & 1 deletion js/getStringModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d03dbc1

Please sign in to comment.