Skip to content

Commit

Permalink
Better default for screen buttons help text, see #989
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Nov 6, 2024
1 parent 07dea6d commit 13c1f31
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions joist-strings_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@
"screenNamePattern": {
"value": "{{name}} Screen"
},
"goToScreenPattern": {
"value": "Go to {{name}} Screen."
},
"screenSimPattern": {
"value": "{{screenName}}, {{simName}}"
},
Expand Down
1 change: 1 addition & 0 deletions js/JoistStrings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ type StringsType = {
'simScreensStringProperty': LocalizedStringProperty;
'simScreenStringProperty': LocalizedStringProperty;
'screenNamePatternStringProperty': LocalizedStringProperty;
'goToScreenPatternStringProperty': LocalizedStringProperty;
'screenSimPatternStringProperty': LocalizedStringProperty;
'homeStringProperty': LocalizedStringProperty;
'homeScreenDescriptionStringProperty': LocalizedStringProperty;
Expand Down
5 changes: 3 additions & 2 deletions js/Screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -247,8 +248,8 @@ class Screen<M extends TModel, V extends ScreenView> 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 } );
}
Expand Down

0 comments on commit 13c1f31

Please sign in to comment.