From 9fc22dc1b5196d1299078967622fb54efd1e2bf8 Mon Sep 17 00:00:00 2001 From: pixelzoom Date: Sat, 27 Aug 2022 10:47:54 -0600 Subject: [PATCH] support for dynamic locale, https://github.com/phetsims/natural-selection/issues/319 --- js/common/view/PlayButtonGroup.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/common/view/PlayButtonGroup.js b/js/common/view/PlayButtonGroup.js index 7bc878eb..22d199ef 100644 --- a/js/common/view/PlayButtonGroup.js +++ b/js/common/view/PlayButtonGroup.js @@ -44,7 +44,7 @@ class PlayButtonGroup extends Node { }, options ); // 'Add a Mate' push button, for when the initial population consists of a single bunny. - const addAMateButton = new TextPushButton( naturalSelectionStrings.addAMate, { + const addAMateButton = new TextPushButton( naturalSelectionStrings.addAMateProperty, { listener: () => { options.addAMate(); simulationModeProperty.value = SimulationMode.ACTIVE; @@ -53,7 +53,7 @@ class PlayButtonGroup extends Node { } ); // 'Play' push button, for when the initial population consists of more than one bunny. - const playButton = new TextPushButton( naturalSelectionStrings.play, { + const playButton = new TextPushButton( naturalSelectionStrings.playProperty, { listener: () => { options.play(); simulationModeProperty.value = SimulationMode.ACTIVE; @@ -63,7 +63,7 @@ class PlayButtonGroup extends Node { // 'Start Over' push button, displayed after the game ends (bunnie take over the world, or all bunnies die), // while the user is reviewing the final state. - const startOverButton = new TextPushButton( naturalSelectionStrings.startOver, { + const startOverButton = new TextPushButton( naturalSelectionStrings.startOverProperty, { listener: () => { options.startOver(); simulationModeProperty.value = SimulationMode.STAGED; @@ -135,10 +135,10 @@ class PlayButtonGroup extends Node { class TextPushButton extends RectangularPushButton { /** - * @param {string} label + * @param {TReadOnlyProperty} stringProperty * @param {Object} [options] */ - constructor( label, options ) { + constructor( stringProperty, options ) { options = merge( { textOptions: { @@ -158,7 +158,7 @@ class TextPushButton extends RectangularPushButton { assert && assert( !options.content, 'TextPushButton sets content' ); assert && assert( !options.textOptions.tandem, 'TextPushButton sets textOptions.tandem' ); - options.content = new Text( label, merge( {}, options.textOptions, { + options.content = new Text( stringProperty, merge( {}, options.textOptions, { tandem: options.tandem.createTandem( 'textNode' ) } ) );