Skip to content

Commit

Permalink
support dynamic locale, #441
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Aug 30, 2022
1 parent 098519a commit 706600a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions js/common/view/labels/OpticalImageLabelNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ export default class OpticalImageLabelNode extends LabelNode {
isNumberedProperty: new BooleanProperty( true )
}, providedOptions );

const stringParams = { imageNumber: opticalImage.opticalObject.opticalObjectNumber };

const labelStringProperty = new DerivedProperty( [
opticalImage.opticalImageTypeProperty,
options.isNumberedProperty,
Expand All @@ -66,9 +64,10 @@ export default class OpticalImageLabelNode extends LabelNode {
if ( isNumbered ) {

// Switch between 'Real Image N' and 'Virtual Image N'
text = ( opticalImageType === 'real' ) ?
StringUtils.fillIn( geometricOpticsStrings.label.realImageN, stringParams ) :
StringUtils.fillIn( geometricOpticsStrings.label.virtualImageN, stringParams );
const stringPattern = ( opticalImageType === 'real' ) ? realImageNString : virtualImageNString;
text = StringUtils.fillIn( stringPattern, {
imageNumber: opticalImage.opticalObject.opticalObjectNumber
} );
}
else {

Expand Down

0 comments on commit 706600a

Please sign in to comment.