From 13c1f31ab0b413d1ef465a2e9a965a451c5798b0 Mon Sep 17 00:00:00 2001 From: Jesse Date: Wed, 6 Nov 2024 17:21:09 -0500 Subject: [PATCH] Better default for screen buttons help text, see https://github.com/phetsims/joist/issues/989 --- joist-strings_en.json | 3 +++ js/JoistStrings.ts | 1 + js/Screen.ts | 5 +++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/joist-strings_en.json b/joist-strings_en.json index b9d430df..b972f27c 100644 --- a/joist-strings_en.json +++ b/joist-strings_en.json @@ -331,6 +331,9 @@ "screenNamePattern": { "value": "{{name}} Screen" }, + "goToScreenPattern": { + "value": "Go to {{name}} Screen." + }, "screenSimPattern": { "value": "{{screenName}}, {{simName}}" }, diff --git a/js/JoistStrings.ts b/js/JoistStrings.ts index 160e26f2..781f1ff2 100644 --- a/js/JoistStrings.ts +++ b/js/JoistStrings.ts @@ -153,6 +153,7 @@ type StringsType = { 'simScreensStringProperty': LocalizedStringProperty; 'simScreenStringProperty': LocalizedStringProperty; 'screenNamePatternStringProperty': LocalizedStringProperty; + 'goToScreenPatternStringProperty': LocalizedStringProperty; 'screenSimPatternStringProperty': LocalizedStringProperty; 'homeStringProperty': LocalizedStringProperty; 'homeScreenDescriptionStringProperty': LocalizedStringProperty; diff --git a/js/Screen.ts b/js/Screen.ts index c93af392..9f5dfd3a 100644 --- a/js/Screen.ts +++ b/js/Screen.ts @@ -38,6 +38,7 @@ import ScreenView from './ScreenView.js'; import TModel from './TModel.js'; const screenNamePatternStringProperty = JoistStrings.a11y.screenNamePatternStringProperty; +const goToScreenPatternStringProperty = JoistStrings.a11y.goToScreenPatternStringProperty; const screenSimPatternStringProperty = JoistStrings.a11y.screenSimPatternStringProperty; const simScreenStringProperty = JoistStrings.a11y.simScreenStringProperty; @@ -247,8 +248,8 @@ class Screen extends PhetioObject { } else if ( this.nameProperty.value ) { - // Fall back to "{{Screen Name}} Screen" as a default. - this.screenButtonsHelpText = new PatternStringProperty( screenNamePatternStringProperty, { + // Fall back to "Go to {{Screen Name}} Screen" as a default. + this.screenButtonsHelpText = new PatternStringProperty( goToScreenPatternStringProperty, { name: this.nameProperty }, { tandem: Tandem.OPT_OUT } ); }