Skip to content

Commit

Permalink
Use i18n strings, see #45
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Mar 4, 2022
1 parent b52977c commit 1a45bd4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions center-and-spread-strings_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
"medianEqualsValue": {
"value": "Median = {{value}}"
},
"plotType": {
"value": "Plot Type"
},
"dotPlot": {
"value": "Dot Plot"
},
Expand Down
1 change: 1 addition & 0 deletions js/centerAndSpreadStrings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type StringsType = {
'sortData': string,
'meanEqualsValue': string,
'medianEqualsValue': string,
'plotType': string,
'dotPlot': string,
'linePlot': string,
'median': string,
Expand Down
11 changes: 5 additions & 6 deletions js/common/view/GlobalOptionsNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,26 @@ import Tandem from '../../../../tandem/js/Tandem.js';
import PlotType from '../model/PlotType.js';
import CASConstants from '../CASConstants.js';
import PhetFont from '../../../../scenery-phet/js/PhetFont.js';
import centerAndSpreadStrings from '../../centerAndSpreadStrings.js';

class GlobalOptionsNode extends VBox {
private disposeGlobalOptionsNode: () => void;

// TODO: Tandem in the options?
// TODO: Tandem in the options? And use tandem in the file?
constructor( tandem: Tandem ) {

// TODO: Use translated strings
const title = new Text( 'Plot Type', {
const title = new Text( centerAndSpreadStrings.plotType, {
font: new PhetFont( 24 )
} );

const TEXT_OPTIONS = {
font: new PhetFont( 18 )
};
// TODO: Use translated strings
const radioButtonGroup = new VerticalAquaRadioButtonGroup<PlotType>( CASConstants.PLOT_TYPE_PROPERTY, [ {
node: new Text( 'Line Plot', TEXT_OPTIONS ),
node: new Text( centerAndSpreadStrings.linePlot, TEXT_OPTIONS ),
value: PlotType.LINE_PLOT
}, {
node: new Text( 'Dot Plot', TEXT_OPTIONS ),
node: new Text( centerAndSpreadStrings.dotPlot, TEXT_OPTIONS ),
value: PlotType.DOT_PLOT
} ] );

Expand Down

0 comments on commit 1a45bd4

Please sign in to comment.