Skip to content

Commit

Permalink
support for dynamic locale, phetsims/graphing-quadratics#178
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Jun 6, 2023
1 parent 3979a6e commit 62f5cc3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/linegame/view/LineGameLevelSelectionButtonGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import graphingLines from '../../graphingLines.js';
import GraphingLinesStrings from '../../GraphingLinesStrings.js';
import GamePhase from '../model/GamePhase.js';
import LineGameModel from '../model/LineGameModel.js';
import DerivedProperty from '../../../../axon/js/DerivedProperty.js';

type SelfOptions = EmptySelfOptions;

Expand Down Expand Up @@ -82,7 +83,10 @@ export default class LineGameLevelSelectionButtonGroup extends LevelSelectionBut
function createLevelSelectionButtonIcon( level: number, levelImage: HTMLImageElement, iconAlignGroup: AlignGroup ): Node {

// Level N
const label = new Text( StringUtils.format( GraphingLinesStrings.pattern_Level_0, level + 1 ), {
const stringProperty = new DerivedProperty( [ GraphingLinesStrings.pattern_Level_0StringProperty ],
pattern => StringUtils.format( GraphingLinesStrings.pattern_Level_0, level + 1 ) );

const text = new Text( stringProperty, {
font: new PhetFont( 40 ),
maxWidth: 100
} );
Expand All @@ -94,7 +98,7 @@ function createLevelSelectionButtonIcon( level: number, levelImage: HTMLImageEle
// 'Level N' centered above image
return new VBox( {
spacing: 15,
children: [ label, image ]
children: [ text, image ]
} );
}

Expand Down

0 comments on commit 62f5cc3

Please sign in to comment.