Skip to content

Commit

Permalink
move "thermometer" into parent string, #182
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Sep 30, 2019
1 parent 187ba4b commit 10395d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions friction-strings_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@
"value": "cool"
},
"statePattern": {
"value": "surface temperature {{thermometer}}is {{temp}}"
"value": "surface temperature is {{temp}}"
},
"stateWithThermometerPattern": {
"value": "surface temperature thermometer is {{temp}}"
},
"cooler": {
"value": "cooler"
Expand All @@ -117,9 +120,6 @@
"value": "now hotter"
}
},
"thermometer": {
"value": "thermometer "
},
"droppingAsAtomsJiggleLess": {
"value": "dropping as atoms jiggle less"
},
Expand Down
11 changes: 5 additions & 6 deletions js/friction/view/FrictionScreenSummaryNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ define( require => {
const Node = require( 'SCENERY/nodes/Node' );
const StringUtils = require( 'PHETCOMMON/util/StringUtils' );


// a11y strings
const summarySentencePatternString = require( 'string!FRICTION/a11y.summarySentencePattern' );
const droppingAsAtomsJiggleLessString = require( 'string!FRICTION/a11y.droppingAsAtomsJiggleLess' );
const atomsJigglePatternString = require( 'string!FRICTION/a11y.atomsJigglePattern' );
const jiggleClausePatternString = require( 'string!FRICTION/a11y.jiggleClausePattern' );
const jiggleTemperatureScaleSentenceString = require( 'string!FRICTION/a11y.jiggleTemperatureScaleSentence' );
const thermometerString = require( 'string!FRICTION/a11y.thermometer' );
const temperatureStateWithThermometerPatternString = require( 'string!FRICTION/a11y.temperature.stateWithThermometerPattern' );
const temperatureStatePatternString = require( 'string!FRICTION/a11y.temperature.statePattern' );
const moveChemistryBookSentenceString = require( 'string!FRICTION/a11y.moveChemistryBookSentence' );
const resetSimMoreObservationSentenceString = require( 'string!FRICTION/a11y.resetSimMoreObservationSentence' );
Expand Down Expand Up @@ -68,7 +67,7 @@ define( require => {

// Not if it is completely cool, so we don't trigger the update too much.
const amplitudeSettledButNotMin = amplitude < FrictionModel.AMPLITUDE_SETTLED_THRESHOLD && // considered in a "settled" state
amplitude !== FrictionModel.VIBRATION_AMPLITUDE_MIN; // not the minimum amplitude
amplitude !== FrictionModel.VIBRATION_AMPLITUDE_MIN; // not the minimum amplitude

// nested if statements so that we don't have to calculate these strings as much
if ( tempDecreasing ||
Expand Down Expand Up @@ -212,9 +211,9 @@ define( require => {
}

// Fill in the current temperature string
const tempString = StringUtils.fillIn( temperatureStatePatternString, {
temp: this.amplitudeToTempString( vibrationAmplitudeProperty.value ),
thermometer: inTransition ? '' : thermometerString
const tempString = StringUtils.fillIn( inTransition ? temperatureStatePatternString :
temperatureStateWithThermometerPatternString, {
temp: this.amplitudeToTempString( vibrationAmplitudeProperty.value )
} );

// Construct the final sentence from its parts
Expand Down

0 comments on commit 10395d4

Please sign in to comment.