Skip to content

Commit

Permalink
Always use plural earth days/minutes, see #463
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Oct 7, 2022
1 parent 80e3403 commit ba33397
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
6 changes: 0 additions & 6 deletions gravity-and-orbits-strings_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
"ourSun": {
"value": "Our Sun"
},
"earthDay": {
"value": "Earth Day"
},
"planet": {
"value": "Planet"
},
Expand Down Expand Up @@ -95,9 +92,6 @@
"ourMoon": {
"value": "Our Moon"
},
"earthMinute": {
"value": "Earth Minute"
},
"returnObjects": {
"value": "Return Objects"
},
Expand Down
4 changes: 0 additions & 4 deletions js/GravityAndOrbitsStrings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ type StringsType = {
'earthMassesStringProperty': LinkableProperty<string>;
'ourSun': string;
'ourSunStringProperty': LinkableProperty<string>;
'earthDay': string;
'earthDayStringProperty': LinkableProperty<string>;
'planet': string;
'planetStringProperty': LinkableProperty<string>;
'planetMass': string;
Expand Down Expand Up @@ -77,8 +75,6 @@ type StringsType = {
'pathStringProperty': LinkableProperty<string>;
'ourMoon': string;
'ourMoonStringProperty': LinkableProperty<string>;
'earthMinute': string;
'earthMinuteStringProperty': LinkableProperty<string>;
'returnObjects': string;
'returnObjectsStringProperty': LinkableProperty<string>;
'star': string;
Expand Down
12 changes: 4 additions & 8 deletions js/common/SceneFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,14 +374,12 @@ const getSwitchableRenderer = ( image1: string | HTMLImageElement, image2: strin
const scaledDays = ( timeProperty: TProperty<number>, tandem: Tandem ) => {
return new DerivedProperty( [
timeProperty,
GravityAndOrbitsStrings.earthDayStringProperty,
GravityAndOrbitsStrings.earthDaysStringProperty,
GravityAndOrbitsStrings.pattern[ '0value' ][ '1unitsStringProperty' ]
], ( time, earthDayString, earthDaysString, patternString ) => {
], ( time, earthDaysString, patternString ) => {
const value = ( time / GravityAndOrbitsClock.SECONDS_PER_DAY );
const fixedValue = Utils.toFixed( value, 0 );
const units = ( fixedValue === '1' ) ? earthDayString : earthDaysString;
return StringUtils.format( patternString, fixedValue, units );
return StringUtils.format( patternString, fixedValue, earthDaysString );
}, {
tandem: tandem,
phetioValueType: StringIO
Expand All @@ -395,14 +393,12 @@ const scaledDays = ( timeProperty: TProperty<number>, tandem: Tandem ) => {
const formatMinutes = ( timeProperty: TProperty<number>, tandem: Tandem ) => {
return new DerivedProperty( [
timeProperty,
GravityAndOrbitsStrings.earthMinuteStringProperty,
GravityAndOrbitsStrings.earthMinutesStringProperty,
GravityAndOrbitsStrings.pattern[ '0value' ][ '1unitsStringProperty' ]
], ( time, earthMinuteString, earthMinutesString, patternString ) => {
], ( time, earthMinutesString, patternString ) => {
const value = ( time / SECONDS_PER_MINUTE );
const fixedValue = Utils.toFixed( value, 0 );
const units = ( fixedValue === '1' ) ? earthMinuteString : earthMinutesString;
return StringUtils.format( patternString, fixedValue, units );
return StringUtils.format( patternString, fixedValue, earthMinutesString );
}, {
tandem: tandem,
phetioValueType: StringIO
Expand Down

0 comments on commit ba33397

Please sign in to comment.