@@ -40,6 +40,7 @@ const noneStringProperty = GreenhouseEffectStrings.concentrationPanel.noneString
40
40
const carbonDioxideConcentrationPatternStringProperty = GreenhouseEffectStrings . concentrationPanel . carbonDioxideConcentrationPatternStringProperty ;
41
41
const methaneConcentrationPatternStringProperty = GreenhouseEffectStrings . concentrationPanel . methaneConcentrationPatternStringProperty ;
42
42
const nitrousOxideConcentrationPatternStringProperty = GreenhouseEffectStrings . concentrationPanel . nitrousOxideConcentrationPatternStringProperty ;
43
+ const iceAgeStringProperty = GreenhouseEffectStrings . concentrationPanel . iceAgeStringProperty ;
43
44
44
45
// Height in view coordinates of the concentration slider track (when controlling concentration by value) and the
45
46
// concentration meter graphic (when controlling by date). These are the same height so that the positions of values
@@ -68,6 +69,11 @@ const SLIDER_THUMB_LINE_WIDTH = 1;
68
69
// color of meters and controls in this panel
69
70
const CONCENTRATION_CONTROLS_STROKE = 'black' ;
70
71
72
+ // numeric date representations are not translatable, see https://github.com/phetsims/greenhouse-effect/issues/21
73
+ const STRING_2020 = '2020' ;
74
+ const STRING_1950 = '1950' ;
75
+ const STRING_1750 = '1750' ;
76
+
71
77
const RADIO_BUTTON_GROUP_OPTIONS = {
72
78
radioButtonOptions : {
73
79
baseColor : GreenhouseEffectColors . controlPanelBackgroundColorProperty ,
@@ -194,34 +200,28 @@ class DateControl extends HBox {
194
200
concentrationControlModeProperty : EnumerationProperty < ConcentrationControlMode > ,
195
201
tandem : Tandem ) {
196
202
197
- // numeric date representations are not translatable, see https://github.com/phetsims/greenhouse-effect/issues/21
198
- const twentyTwentyLabel = '2020' ;
199
- const nineteenFiftyLabel = '1950' ;
200
- const seventeenFiftyLabel = '1750' ;
201
- const iceAgeLabel = GreenhouseEffectStrings . concentrationPanel . iceAgeStringProperty . value ;
202
-
203
203
// the radio buttons for the date control
204
204
const items = [
205
205
{
206
- createNode : ( ) => new Text ( twentyTwentyLabel , LABEL_OPTIONS ) ,
206
+ createNode : ( ) => new Text ( STRING_2020 , LABEL_OPTIONS ) ,
207
207
value : ConcentrationDate . YEAR_2020 ,
208
208
labelContent : GreenhouseEffectStrings . a11y . concentrationPanel . timePeriod . yearTwentyTwentyStringProperty ,
209
209
tandemName : 'twentyTwentyRadioButton'
210
210
} ,
211
211
{
212
- createNode : ( ) => new Text ( nineteenFiftyLabel , LABEL_OPTIONS ) ,
212
+ createNode : ( ) => new Text ( STRING_1950 , LABEL_OPTIONS ) ,
213
213
value : ConcentrationDate . YEAR_1950 ,
214
214
labelContent : GreenhouseEffectStrings . a11y . concentrationPanel . timePeriod . yearNineteenFiftyStringProperty ,
215
215
tandemName : 'nineteenFiftyRadioButton'
216
216
} ,
217
217
{
218
- createNode : ( ) => new Text ( seventeenFiftyLabel , LABEL_OPTIONS ) ,
218
+ createNode : ( ) => new Text ( STRING_1750 , LABEL_OPTIONS ) ,
219
219
value : ConcentrationDate . YEAR_1750 ,
220
220
labelContent : GreenhouseEffectStrings . a11y . concentrationPanel . timePeriod . yearSeventeenFiftyStringProperty ,
221
221
tandemName : 'seventeenFiftyRadioButton'
222
222
} ,
223
223
{
224
- createNode : ( ) => new Text ( iceAgeLabel , LABEL_OPTIONS ) ,
224
+ createNode : ( ) => new Text ( iceAgeStringProperty , LABEL_OPTIONS ) ,
225
225
value : ConcentrationDate . ICE_AGE ,
226
226
labelContent : GreenhouseEffectStrings . a11y . concentrationPanel . timePeriod . iceAgeStringProperty ,
227
227
tandemName : 'iceAgeRadioButton'
0 commit comments