From 8d1a761a5024338b652bf43a791f29e4d282184b Mon Sep 17 00:00:00 2001 From: zepumph Date: Mon, 30 Dec 2019 11:56:09 -0900 Subject: [PATCH] reorganize a11y strings into nested structure, remove comments, https://github.com/phetsims/molarity/issues/205 (cherry picked from commit fbde0f1517121cd55fa06d4394de054e6b3f2702) --- js/molarity/view/BeakerNode.js | 2 +- .../view/MolarityBeakerDescriptionNode.js | 16 +- .../view/MolarityKeyboardHelpContent.js | 16 +- js/molarity/view/MolarityScreenSummaryNode.js | 20 +- .../view/describers/ConcentrationDescriber.js | 24 +- .../describers/PrecipitateAmountDescriber.js | 2 +- .../view/describers/SoluteAmountDescriber.js | 22 +- .../view/describers/SoluteDescriber.js | 4 +- .../view/describers/VolumeDescriber.js | 22 +- js/molarity/view/molarityAlertManager.js | 8 +- molarity-strings_en.json | 248 +++++++++--------- 11 files changed, 193 insertions(+), 191 deletions(-) diff --git a/js/molarity/view/BeakerNode.js b/js/molarity/view/BeakerNode.js index 12172d1a..a23cf208 100644 --- a/js/molarity/view/BeakerNode.js +++ b/js/molarity/view/BeakerNode.js @@ -33,7 +33,7 @@ define( require => { const unitsLitersString = require( 'string!MOLARITY/units.liters' ); // a11y strings - const beakerHeaderString = require( 'string!MOLARITY/a11y.beakerHeader' ); + const beakerHeaderString = require( 'string!MOLARITY/a11y.beaker.header' ); // constants const DEBUG_SHAPES = false; diff --git a/js/molarity/view/MolarityBeakerDescriptionNode.js b/js/molarity/view/MolarityBeakerDescriptionNode.js index eaf31610..864585fb 100644 --- a/js/molarity/view/MolarityBeakerDescriptionNode.js +++ b/js/molarity/view/MolarityBeakerDescriptionNode.js @@ -19,11 +19,11 @@ define( require => { const drinkMixString = require( 'string!MOLARITY/drinkMix' ); // a11y strings - const beakerDescriptionPatternString = require( 'string!MOLARITY/a11y.beakerDescriptionPattern' ); - const hasZeroConcentrationString = require( 'string!MOLARITY/a11y.hasZeroConcentration' ); - const beakerDescriptionPureWaterPatternString = require( 'string!MOLARITY/a11y.beakerDescriptionPureWaterPattern' ); - const pureWaterString = require( 'string!MOLARITY/a11y.pureWater' ); - const waterFormulaDescriptionString = require( 'string!MOLARITY/a11y.waterFormulaDescription' ); + const beakerDescriptionPatternString = require( 'string!MOLARITY/a11y.beaker.descriptionPattern' ); + const beakerHasZeroConcentrationString = require( 'string!MOLARITY/a11y.beaker.hasZeroConcentration' ); + const beakerDescriptionPureWaterPatternString = require( 'string!MOLARITY/a11y.beaker.descriptionPureWaterPattern' ); + const beakerPureWaterString = require( 'string!MOLARITY/a11y.beaker.pureWater' ); + const beakerWaterFormulaDescriptionString = require( 'string!MOLARITY/a11y.beaker.waterFormulaDescription' ); class MolarityBeakerDescriptionNode extends Node { @@ -105,7 +105,7 @@ define( require => { updateBeakerSummaryString() { const summaryString = !this.solution.hasSolute() ? beakerDescriptionPureWaterPatternString : beakerDescriptionPatternString; return StringUtils.fillIn( summaryString, { - solute: !this.solution.hasSolute() ? pureWaterString : this.soluteDescriber.getCurrentSoluteName(), + solute: !this.solution.hasSolute() ? beakerPureWaterString : this.soluteDescriber.getCurrentSoluteName(), volume: this.volumeDescriber.getCurrentVolume( true ), color: this.soluteDescriber.getCurrentColor() } ); @@ -135,7 +135,7 @@ define( require => { */ updateConcentrationSummary() { if ( !this.solution.hasSolute() ) { - this.concentrationSummaryItem.innerContent = hasZeroConcentrationString; + this.concentrationSummaryItem.innerContent = beakerHasZeroConcentrationString; } else { this.concentrationSummaryItem.innerContent = this.concentrationDescriber.getBeakerConcentrationString( @@ -153,7 +153,7 @@ define( require => { if ( !this.solution.hasSolute() ) { // if there is no solute in the beaker, the chemical formula of water is displayed instead. - this.chemicalFormulaSummaryItem.innerContent = ChemUtils.toSubscript( waterFormulaDescriptionString ); + this.chemicalFormulaSummaryItem.innerContent = ChemUtils.toSubscript( beakerWaterFormulaDescriptionString ); this.chemicalFormulaSummaryContainer.children = [ this.chemicalFormulaSummaryItem ]; } diff --git a/js/molarity/view/MolarityKeyboardHelpContent.js b/js/molarity/view/MolarityKeyboardHelpContent.js index a84cdf7f..f9d91406 100644 --- a/js/molarity/view/MolarityKeyboardHelpContent.js +++ b/js/molarity/view/MolarityKeyboardHelpContent.js @@ -27,10 +27,10 @@ define( require => { // a11y strings // Description strings for list of help commands - const popUpListDescriptionString = require( 'string!MOLARITY/a11y.popUpListDescription' ); - const moveThroughDescriptionString = require( 'string!MOLARITY/a11y.moveThroughDescription' ); - const changeChooseDescriptionString = require( 'string!MOLARITY/a11y.changeChooseDescription' ); - const closeListDescriptionString = require( 'string!MOLARITY/a11y.closeListDescription' ); + const helpContentPopUpListDescriptionString = require( 'string!MOLARITY/a11y.helpContent.popUpListDescription' ); + const helpContentMoveThroughDescriptionString = require( 'string!MOLARITY/a11y.helpContent.moveThroughDescription' ); + const helpContentChangeChooseDescriptionString = require( 'string!MOLARITY/a11y.helpContent.changeChooseDescription' ); + const helpContentCloseListDescriptionString = require( 'string!MOLARITY/a11y.helpContent.closeListDescription' ); // constants const labelWithIcon = KeyboardHelpSection.labelWithIcon; @@ -44,10 +44,10 @@ define( require => { const sliderKeyboardHelpSection = new SliderKeyboardHelpSection( { headingString: keyboardSliderHelpHeadingString } ); // change solute help section - const step1 = labelWithIcon( keyboardPopUpListString, KeyboardHelpIconFactory.enterOrSpace(), popUpListDescriptionString ); - const step2 = labelWithIcon( keyboardMoveThroughString, KeyboardHelpIconFactory.upOrDown(), moveThroughDescriptionString ); - const step3 = labelWithIcon( keyboardChangeSoluteString, KeyboardHelpIconFactory.enter(), changeChooseDescriptionString ); - const step4 = labelWithIcon( keyboardCloseListString, KeyboardHelpIconFactory.esc(), closeListDescriptionString ); + const step1 = labelWithIcon( keyboardPopUpListString, KeyboardHelpIconFactory.enterOrSpace(), helpContentPopUpListDescriptionString ); + const step2 = labelWithIcon( keyboardMoveThroughString, KeyboardHelpIconFactory.upOrDown(), helpContentMoveThroughDescriptionString ); + const step3 = labelWithIcon( keyboardChangeSoluteString, KeyboardHelpIconFactory.enter(), helpContentChangeChooseDescriptionString ); + const step4 = labelWithIcon( keyboardCloseListString, KeyboardHelpIconFactory.esc(), helpContentCloseListDescriptionString ); const changeSoluteContent = [ step1, step2, step3, step4 ]; const changeSoluteHelpSection = new KeyboardHelpSection( keyboardChangeSoluteHelpHeadingString, changeSoluteContent, { a11yContentTagName: 'ol' diff --git a/js/molarity/view/MolarityScreenSummaryNode.js b/js/molarity/view/MolarityScreenSummaryNode.js index 9649d24c..6854215f 100644 --- a/js/molarity/view/MolarityScreenSummaryNode.js +++ b/js/molarity/view/MolarityScreenSummaryNode.js @@ -17,14 +17,14 @@ define( require => { // a11y strings const ofString = require( 'string!MOLARITY/a11y.of' ); const notSaturatedString = require( 'string!MOLARITY/a11y.notSaturated' ); - const screenSummaryQualitativeConcentrationPatternString = require( 'string!MOLARITY/a11y.screenSummaryQualitativeConcentrationPattern' ); - const screenSummaryQuantitativeConcentrationPatternString = require( 'string!MOLARITY/a11y.screenSummaryQuantitativeConcentrationPattern' ); + const screenSummaryQualitativeConcentrationPatternString = require( 'string!MOLARITY/a11y.screenSummary.qualitativeConcentrationPattern' ); + const screenSummaryQuantitativeConcentrationPatternString = require( 'string!MOLARITY/a11y.screenSummary.quantitativeConcentrationPattern' ); const saturatedString = require( 'string!MOLARITY/a11y.saturated' ); - const screenSummaryPlayAreaPatternString = require( 'string!MOLARITY/a11y.screenSummaryPlayAreaPattern' ); - const screenSummaryControlAreaPatternString = require( 'string!MOLARITY/a11y.screenSummaryControlAreaPattern' ); - const simInteractionHintString = require( 'string!MOLARITY/a11y.simInteractionHint' ); - const currentStateOfSimNoSolutePatternString = require( 'string!MOLARITY/a11y.currentStateOfSimNoSolutePattern' ); - const currentStateOfSimPatternString = require( 'string!MOLARITY/a11y.currentStateOfSimPattern' ); + const screenSummaryPlayAreaPatternString = require( 'string!MOLARITY/a11y.screenSummary.playAreaPattern' ); + const screenSummaryControlAreaPatternString = require( 'string!MOLARITY/a11y.screenSummary.controlAreaPattern' ); + const screenSummarySimInteractionHintString = require( 'string!MOLARITY/a11y.screenSummary.simInteractionHint' ); + const screenSummaryCurrentStateOfSimNoSolutePatternString = require( 'string!MOLARITY/a11y.screenSummary.currentStateOfSimNoSolutePattern' ); + const screenSummaryCurrentStateOfSimPatternString = require( 'string!MOLARITY/a11y.screenSummary.currentStateOfSimPattern' ); class MolarityScreenSummaryNode extends Node { @@ -72,7 +72,7 @@ define( require => { // Fourth paragraph of the screen summary -- static regardless of state of sim, gives the interaction hint this.addChild( new Node( { tagName: 'p', - innerContent: simInteractionHintString + innerContent: screenSummarySimInteractionHintString } ) ); // Updates the third paragraph of the screen summary when sim Properties change. @@ -93,7 +93,7 @@ define( require => { * descriptions are show, and whether or not there is some solute in the beaker. */ getStateOfSimDescription() { - let stateString = currentStateOfSimPatternString; + let stateString = screenSummaryCurrentStateOfSimPatternString; // concentrationString will form the base of the concentrationPattern substring (filled in below) const concentrationString = this.useQuantitativeDescriptionsProperty.value ? @@ -106,7 +106,7 @@ define( require => { // If there is no solute in the beaker, the PDOM descriptions change. if ( !this.solution.hasSolute() ) { - stateString = currentStateOfSimNoSolutePatternString; + stateString = screenSummaryCurrentStateOfSimNoSolutePatternString; } return StringUtils.fillIn( stateString, { diff --git a/js/molarity/view/describers/ConcentrationDescriber.js b/js/molarity/view/describers/ConcentrationDescriber.js index edb97a4f..22df0a4c 100644 --- a/js/molarity/view/describers/ConcentrationDescriber.js +++ b/js/molarity/view/describers/ConcentrationDescriber.js @@ -17,12 +17,12 @@ define( require => { const StringUtils = require( 'PHETCOMMON/util/StringUtils' ); // a11y strings - const colorChangePatternString = require( 'string!MOLARITY/a11y.colorChangePattern' ); - const concentrationAndUnitString = require( 'string!MOLARITY/a11y.concentrationAndUnit' ); - const concentrationChangePatternString = require( 'string!MOLARITY/a11y.concentrationChangePattern' ); - const beakerConcentrationRangePatternString = require( 'string!MOLARITY/a11y.beakerConcentrationRangePattern' ); - const qualitativeConcentrationStateClausePatternString = require( 'string!MOLARITY/a11y.qualitativeConcentrationStateClausePattern' ); - const quantitativeConcentrationStatePatternString = require( 'string!MOLARITY/a11y.quantitativeConcentrationStatePattern' ); + const quantityChangeColorChangePatternString = require( 'string!MOLARITY/a11y.quantityChange.colorChangePattern' ); + const quantitativeConcentrationAndUnitString = require( 'string!MOLARITY/a11y.quantitative.concentrationAndUnit' ); + const quantityChangeConcentrationChangePatternString = require( 'string!MOLARITY/a11y.quantityChange.concentrationChangePattern' ); + const beakerConcentrationRangePatternString = require( 'string!MOLARITY/a11y.beaker.concentrationRangePattern' ); + const qualitativeConcentrationStateClausePatternString = require( 'string!MOLARITY/a11y.qualitative.concentrationStateClausePattern' ); + const quantitativeConcentrationStatePatternString = require( 'string!MOLARITY/a11y.quantitative.concentrationStatePattern' ); // Concentration region strings const concentrationRegionsPassiveZeroConcentrationString = require( 'string!MOLARITY/a11y.concentrationRegions.passive.zeroConcentration' ); @@ -47,8 +47,8 @@ define( require => { const lessLowercaseString = require( 'string!MOLARITY/a11y.less.lowercase' ); const moreCapitalizedString = require( 'string!MOLARITY/a11y.more.capitalized' ); const moreLowercaseString = require( 'string!MOLARITY/a11y.more.lowercase' ); - const lighterString = require( 'string!MOLARITY/a11y.lighter' ); - const darkerString = require( 'string!MOLARITY/a11y.darker' ); + const quantityChangeLighterString = require( 'string!MOLARITY/a11y.quantityChange.lighter' ); + const quantityChangeDarkerString = require( 'string!MOLARITY/a11y.quantityChange.darker' ); // constants const ACTIVE_CONCENTRATION_STRINGS = [ @@ -154,7 +154,7 @@ define( require => { getCurrentConcentrationClause( isPassive = false ) { const concentration = this.concentrationProperty.value; if ( this.useQuantitativeDescriptionsProperty.value ) { - return StringUtils.fillIn( concentrationAndUnitString, { + return StringUtils.fillIn( quantitativeConcentrationAndUnitString, { concentration: Util.toFixed( concentration, MolarityConstants.CONCENTRATION_DECIMAL_PLACES ) } ); } @@ -220,7 +220,7 @@ define( require => { if ( this.concentrationIncreased ) { moreLessString = isCapitalized ? moreCapitalizedString : moreLowercaseString; } - return StringUtils.fillIn( concentrationChangePatternString, { + return StringUtils.fillIn( quantityChangeConcentrationChangePatternString, { moreLess: moreLessString } ); } @@ -233,8 +233,8 @@ define( require => { getColorChangeString() { assert && assert( !this.solution.isSaturated(), 'color cannot change when saturated' ); - return StringUtils.fillIn( colorChangePatternString, { - lighterDarker: this.concentrationIncreased ? darkerString : lighterString + return StringUtils.fillIn( quantityChangeColorChangePatternString, { + lighterDarker: this.concentrationIncreased ? quantityChangeDarkerString : quantityChangeLighterString } ); } diff --git a/js/molarity/view/describers/PrecipitateAmountDescriber.js b/js/molarity/view/describers/PrecipitateAmountDescriber.js index 62644b79..df72183e 100644 --- a/js/molarity/view/describers/PrecipitateAmountDescriber.js +++ b/js/molarity/view/describers/PrecipitateAmountDescriber.js @@ -21,7 +21,7 @@ define( require => { // a11y strings const atMaxConcentrationPatternString = require( 'string!MOLARITY/a11y.atMaxConcentrationPattern' ); - const beakerSaturationPatternString = require( 'string!MOLARITY/a11y.beakerSaturationPattern' ); + const beakerSaturationPatternString = require( 'string!MOLARITY/a11y.beaker.saturationPattern' ); const saturationLostQualitativeAlertPatternString = require( 'string!MOLARITY/a11y.saturationLostQualitativeAlertPattern' ); const saturationLostQuantitativeAlertPatternString = require( 'string!MOLARITY/a11y.saturationLostQuantitativeAlertPattern' ); const saturationReachedAlertPatternString = require( 'string!MOLARITY/a11y.saturationReachedAlertPattern' ); diff --git a/js/molarity/view/describers/SoluteAmountDescriber.js b/js/molarity/view/describers/SoluteAmountDescriber.js index e0267ad7..e58fac16 100644 --- a/js/molarity/view/describers/SoluteAmountDescriber.js +++ b/js/molarity/view/describers/SoluteAmountDescriber.js @@ -16,11 +16,11 @@ define( require => { const Util = require( 'DOT/Util' ); // a11y strings - const beakerSoluteAmountPatternString = require( 'string!MOLARITY/a11y.beakerSoluteAmountPattern' ); - const soluteAmountAndUnitPatternString = require( 'string!MOLARITY/a11y.soluteAmountAndUnitPattern' ); - const soluteAmountChangedPatternString = require( 'string!MOLARITY/a11y.soluteAmountChangedPattern' ); - const colorChangePatternString = require( 'string!MOLARITY/a11y.colorChangePattern' ); - const qualitativeSoluteAmountStatePatternString = require( 'string!MOLARITY/a11y.qualitativeSoluteAmountStatePattern' ); + const beakerSoluteAmountPatternString = require( 'string!MOLARITY/a11y.beaker.soluteAmountPattern' ); + const quantitativeSoluteAmountAndUnitPatternString = require( 'string!MOLARITY/a11y.quantitative.soluteAmountAndUnitPattern' ); + const quantityChangeSoluteAmountChangedPatternString = require( 'string!MOLARITY/a11y.quantityChange.soluteAmountChangedPattern' ); + const quantityChangeColorChangePatternString = require( 'string!MOLARITY/a11y.quantityChange.colorChangePattern' ); + const qualitativeSoluteAmountStatePatternString = require( 'string!MOLARITY/a11y.qualitative.soluteAmountStatePattern' ); // solute amount regions capitalized strings const soluteAmountRegionsCapitalizedNoString = require( 'string!MOLARITY/a11y.soluteAmountRegions.capitalized.no' ); @@ -43,8 +43,8 @@ define( require => { // change strings const lessCapitalizedString = require( 'string!MOLARITY/a11y.less.capitalized' ); const moreCapitalizedString = require( 'string!MOLARITY/a11y.more.capitalized' ); - const lighterString = require( 'string!MOLARITY/a11y.lighter' ); - const darkerString = require( 'string!MOLARITY/a11y.darker' ); + const quantityChangeLighterString = require( 'string!MOLARITY/a11y.quantityChange.lighter' ); + const quantityChangeDarkerString = require( 'string!MOLARITY/a11y.quantityChange.darker' ); // constants const SOLUTE_AMOUNT_STRINGS_CAPITALIZED = [ @@ -135,11 +135,11 @@ define( require => { return { // "quantity" meaning "solute amount" here - quantityChangeString: StringUtils.fillIn( soluteAmountChangedPatternString, { + quantityChangeString: StringUtils.fillIn( quantityChangeSoluteAmountChangedPatternString, { moreLess: this.soluteAmountIncreased ? moreCapitalizedString : lessCapitalizedString } ), - colorChangeString: StringUtils.fillIn( colorChangePatternString, { - lighterDarker: this.soluteAmountIncreased ? darkerString : lighterString + colorChangeString: StringUtils.fillIn( quantityChangeColorChangePatternString, { + lighterDarker: this.soluteAmountIncreased ? quantityChangeDarkerString : quantityChangeLighterString } ) }; } @@ -157,7 +157,7 @@ define( require => { const soluteAmountMax = MolarityConstants.SOLUTE_AMOUNT_RANGE.max; const clampedSoluteAmount = Util.clamp( this.soluteAmountProperty.value, soluteAmountMin, soluteAmountMax ); - return StringUtils.fillIn( soluteAmountAndUnitPatternString, { + return StringUtils.fillIn( quantitativeSoluteAmountAndUnitPatternString, { soluteAmount: Util.toFixed( clampedSoluteAmount, MolarityConstants.SOLUTE_AMOUNT_DECIMAL_PLACES ) } ); } diff --git a/js/molarity/view/describers/SoluteDescriber.js b/js/molarity/view/describers/SoluteDescriber.js index 33c7d3b1..88274f71 100644 --- a/js/molarity/view/describers/SoluteDescriber.js +++ b/js/molarity/view/describers/SoluteDescriber.js @@ -17,10 +17,10 @@ define( require => { const StringUtils = require( 'PHETCOMMON/util/StringUtils' ); // a11y strings - const beakerChemicalFormulaPatternString = require( 'string!MOLARITY/a11y.beakerChemicalFormulaPattern' ); + const beakerChemicalFormulaPatternString = require( 'string!MOLARITY/a11y.beaker.chemicalFormulaPattern' ); const noSoluteAlertQuantitativeString = require( 'string!MOLARITY/a11y.noSoluteAlertQuantitative' ); const noSoluteAlertQualitativeString = require( 'string!MOLARITY/a11y.noSoluteAlertQualitative' ); - const quantitativeConcentrationStatePatternString = require( 'string!MOLARITY/a11y.quantitativeConcentrationStatePattern' ); + const quantitativeConcentrationStatePatternString = require( 'string!MOLARITY/a11y.quantitative.concentrationStatePattern' ); const soluteChangedQuantitativeConcentrationPatternString = require( 'string!MOLARITY/a11y.soluteChangedQuantitativeConcentrationPattern' ); const soluteChangedQualitativeConcentrationPatternString = require( 'string!MOLARITY/a11y.soluteChangedQualitativeConcentrationPattern' ); const soluteChangedSaturatedAlertPatternString = require( 'string!MOLARITY/a11y.soluteChangedSaturatedAlertPattern' ); diff --git a/js/molarity/view/describers/VolumeDescriber.js b/js/molarity/view/describers/VolumeDescriber.js index 8d11e62d..a5a55eb4 100644 --- a/js/molarity/view/describers/VolumeDescriber.js +++ b/js/molarity/view/describers/VolumeDescriber.js @@ -16,11 +16,11 @@ define( require => { const Util = require( 'DOT/Util' ); // a11y strings - const hasVolumePatternString = require( 'string!MOLARITY/a11y.hasVolumePattern' ); - const colorChangePatternString = require( 'string!MOLARITY/a11y.colorChangePattern' ); - const qualitativeVolumeStatePatternString = require( 'string!MOLARITY/a11y.qualitativeVolumeStatePattern' ); - const solutionVolumeAndUnitPatternString = require( 'string!MOLARITY/a11y.solutionVolumeAndUnitPattern' ); - const volumeChangePatternString = require( 'string!MOLARITY/a11y.volumeChangePattern' ); + const quantitativeHasVolumePatternString = require( 'string!MOLARITY/a11y.quantitative.hasVolumePattern' ); + const quantityChangeColorChangePatternString = require( 'string!MOLARITY/a11y.quantityChange.colorChangePattern' ); + const qualitativeVolumeStatePatternString = require( 'string!MOLARITY/a11y.qualitative.volumeStatePattern' ); + const quantitativeSolutionVolumeAndUnitPatternString = require( 'string!MOLARITY/a11y.quantitative.solutionVolumeAndUnitPattern' ); + const quantityChangeVolumeChangePatternString = require( 'string!MOLARITY/a11y.quantityChange.volumeChangePattern' ); // volume regions strings const volumeRegionsPassiveFullString = require( 'string!MOLARITY/a11y.volumeRegions.passive.full' ); @@ -43,8 +43,8 @@ define( require => { // change strings const lessCapitalizedString = require( 'string!MOLARITY/a11y.less.capitalized' ); const moreCapitalizedString = require( 'string!MOLARITY/a11y.more.capitalized' ); - const lighterString = require( 'string!MOLARITY/a11y.lighter' ); - const darkerString = require( 'string!MOLARITY/a11y.darker' ); + const quantityChangeLighterString = require( 'string!MOLARITY/a11y.quantityChange.lighter' ); + const quantityChangeDarkerString = require( 'string!MOLARITY/a11y.quantityChange.darker' ); // constants const VOLUME_STRINGS = [ @@ -119,7 +119,7 @@ define( require => { getCurrentVolume( isActive = false ) { const volumeIndex = volumeToIndex( this.volumeProperty.value ); if ( this.useQuantitativeDescriptionsProperty.value ) { - const quantitativeString = isActive ? hasVolumePatternString : solutionVolumeAndUnitPatternString; + const quantitativeString = isActive ? quantitativeHasVolumePatternString : quantitativeSolutionVolumeAndUnitPatternString; return StringUtils.fillIn( quantitativeString, { volume: Util.toFixed( this.volumeProperty.value, MolarityConstants.SOLUTION_VOLUME_DECIMAL_PLACES ) } ); @@ -143,11 +143,11 @@ define( require => { return { // "quantity" meaning "volume" here - quantityChangeString: StringUtils.fillIn( volumeChangePatternString, { + quantityChangeString: StringUtils.fillIn( quantityChangeVolumeChangePatternString, { moreLess: this.volumeIncreased ? moreCapitalizedString : lessCapitalizedString } ), - colorChangeString: StringUtils.fillIn( colorChangePatternString, { - lighterDarker: this.volumeIncreased ? lighterString : darkerString + colorChangeString: StringUtils.fillIn( quantityChangeColorChangePatternString, { + lighterDarker: this.volumeIncreased ? quantityChangeLighterString : quantityChangeDarkerString } ) }; } diff --git a/js/molarity/view/molarityAlertManager.js b/js/molarity/view/molarityAlertManager.js index f2973134..8fac0f23 100644 --- a/js/molarity/view/molarityAlertManager.js +++ b/js/molarity/view/molarityAlertManager.js @@ -20,10 +20,10 @@ define( require => { // a11y strings const atMaxConcentrationAlertPatternString = require( 'string!MOLARITY/a11y.atMaxConcentrationAlertPattern' ); const noSoluteAlertString = require( 'string!MOLARITY/a11y.noSoluteAlert' ); - const qualitativeSaturatedValueTextPatternString = require( 'string!MOLARITY/a11y.qualitativeSaturatedValueTextPattern' ); - const qualitativeSliderAlertPatternString = require( 'string!MOLARITY/a11y.qualitativeSliderAlertPattern' ); - const quantitativeSaturatedValueTextPatternString = require( 'string!MOLARITY/a11y.quantitativeSaturatedValueTextPattern' ); - const quantitativeSliderAlertPatternString = require( 'string!MOLARITY/a11y.quantitativeSliderAlertPattern' ); + const qualitativeSaturatedValueTextPatternString = require( 'string!MOLARITY/a11y.qualitative.saturatedValueTextPattern' ); + const qualitativeSliderAlertPatternString = require( 'string!MOLARITY/a11y.qualitative.sliderAlertPattern' ); + const quantitativeSaturatedValueTextPatternString = require( 'string!MOLARITY/a11y.quantitative.saturatedValueTextPattern' ); + const quantitativeSliderAlertPatternString = require( 'string!MOLARITY/a11y.quantitative.sliderAlertPattern' ); const solutionValuesCheckedAlertString = require( 'string!MOLARITY/a11y.solutionValuesCheckedAlert' ); const solutionValuesUncheckedAlertString = require( 'string!MOLARITY/a11y.solutionValuesUncheckedAlert' ); diff --git a/molarity-strings_en.json b/molarity-strings_en.json index 8ce2d287..d0de3246 100644 --- a/molarity-strings_en.json +++ b/molarity-strings_en.json @@ -145,142 +145,146 @@ "soluteComboBoxHelpText": { "value": "Choose a different solute for beaker." }, - "_comment1": "///////////////////////// KEYBOARD HELP CONTENT SECTION STRINGS ///////////////////////////////", - "popUpListDescription": { - "value": "Pop up list of solutes with Enter or Space keys" - }, - "moveThroughDescription": { - "value": "Move through solutes with Up and Down arrow keys" - }, - "changeChooseDescription": { - "value": "Choose solute with Enter key" - }, - "closeListDescription": { - "value": "Close list without changing with Esc key" - }, - "_comment2": "///////////////////////// SCREEN SUMMARY STRINGS ///////////////////////////////", - "screenSummaryPlayAreaPattern": { - "value": "In the Play Area, you find a beaker containing a solution, and a concentration readout. You can change solute amount, solution volume, and choose from nine different solutes to play with the solution in beaker." - }, - "screenSummaryControlAreaPattern": { - "value": "In the Control Area there is a checkbox to show exact values for amount of solute (in moles), volume of solution (in liters), and concentration (in molar), and a button to reset the sim." - }, - "currentStateOfSimPattern": { - "value": "Currently, beaker {{volume}} of a {{color}} ‬solution containing {{soluteAmount}} {{of}} ‪{{solute}}‬ solute. {{concentrationClause}}." - }, - "currentStateOfSimNoSolutePattern": { - "value": "Currently, beaker {{volume}} of pure water, and contains no {{solute}} solute." - }, - "simInteractionHint": { - "value": "Play with solution in beaker and observe changes to concentration." - }, - "screenSummaryQuantitativeConcentrationPattern": { - "value": "Solution is {{isSaturated}}, and concentration is {{concentration}}" - }, - "screenSummaryQualitativeConcentrationPattern": { - "value": "Solution is {{isSaturated}} and {{concentration}}" - }, - "pureWater": { - "value": "pure water" - }, - "waterFormulaDescription": { - "value": "chemical formula of pure water is H2O" - }, - "_comment3": "// Beaker description strings", - "beakerHeader": { - "value": "Beaker" - }, - "beakerDescriptionPattern": { - "value": "Beaker {{volume}} of a {{solute}} solution. The {{color}} solution:" - }, - "beakerDescriptionPureWaterPattern": { - "value": "Beaker {{volume}} of pure water. The {{color}} solution:" - }, - "hasZeroConcentration": { - "value": "has zero concentration" - }, - "beakerSoluteAmountPattern": { - "value": "contains {{soluteAmount}} {{solute}}" - }, - "beakerSaturationPattern": { - "value": "is saturated with {{solids}} solids" + "helpContent": { + "popUpListDescription": { + "value": "Pop up list of solutes with Enter or Space keys" + }, + "moveThroughDescription": { + "value": "Move through solutes with Up and Down arrow keys" + }, + "changeChooseDescription": { + "value": "Choose solute with Enter key" + }, + "closeListDescription": { + "value": "Close list without changing with Esc key" + } }, - "beakerChemicalFormulaPattern": { - "value": "chemical formula of {{solute}} is {{chemicalFormula}}" + "screenSummary": { + "playAreaPattern": { + "value": "In the Play Area, you find a beaker containing a solution, and a concentration readout. You can change solute amount, solution volume, and choose from nine different solutes to play with the solution in beaker." + }, + "controlAreaPattern": { + "value": "In the Control Area there is a checkbox to show exact values for amount of solute (in moles), volume of solution (in liters), and concentration (in molar), and a button to reset the sim." + }, + "currentStateOfSimPattern": { + "value": "Currently, beaker {{volume}} of a {{color}} ‬solution containing {{soluteAmount}} {{of}} ‪{{solute}}‬ solute. {{concentrationClause}}." + }, + "currentStateOfSimNoSolutePattern": { + "value": "Currently, beaker {{volume}} of pure water, and contains no {{solute}} solute." + }, + "simInteractionHint": { + "value": "Play with solution in beaker and observe changes to concentration." + }, + "quantitativeConcentrationPattern": { + "value": "Solution is {{isSaturated}}, and concentration is {{concentration}}" + }, + "qualitativeConcentrationPattern": { + "value": "Solution is {{isSaturated}} and {{concentration}}" + } }, - "beakerConcentrationRangePattern": { - "value": "concentration readout range for this solution 0 to {{maxConcentration}} molar" + "beaker": { + "pureWater": { + "value": "pure water" + }, + "waterFormulaDescription": { + "value": "chemical formula of pure water is H2O" + }, + "header": { + "value": "Beaker" + }, + "descriptionPattern": { + "value": "Beaker {{volume}} of a {{solute}} solution. The {{color}} solution:" + }, + "descriptionPureWaterPattern": { + "value": "Beaker {{volume}} of pure water. The {{color}} solution:" + }, + "hasZeroConcentration": { + "value": "has zero concentration" + }, + "soluteAmountPattern": { + "value": "contains {{soluteAmount}} {{solute}}" + }, + "saturationPattern": { + "value": "is saturated with {{solids}} solids" + }, + "chemicalFormulaPattern": { + "value": "chemical formula of {{solute}} is {{chemicalFormula}}" + }, + "concentrationRangePattern": { + "value": "concentration readout range for this solution 0 to {{maxConcentration}} molar" + } }, - "_comment4": "// saturation states", "saturated": { "value": "saturated" }, "notSaturated": { "value": "not saturated" }, - "_comment5": "///////////////////////// VALUE TEXT STRINGS ///////////////////////////////, // Quantitative value text strings for both volume and solute amount sliders", - "solutionVolumeAndUnitPattern": { - "value": "{{volume}} liters" - }, - "hasVolumePattern": { - "value": "has {{volume}} liters" - }, - "soluteAmountAndUnitPattern": { - "value": "{{soluteAmount}} moles" - }, - "quantitativeSaturatedValueTextPattern": { - "value": "{{solidsChange}}. {{stillSaturatedClause}}" - }, - "quantitativeConcentrationStatePattern": { - "value": "concentration {{concentration}}" - }, - "concentrationAndUnit": { - "value": "{{concentration}} molar" - }, - "_comment5": "// Qualitative value text strings for both volume and solute amount sliders", - "qualitativeSaturatedValueTextPattern": { - "value": "{{propertyAmountChange}}, {{solidsChange}}. {{stillSaturatedClause}}" - }, - "qualitativeVolumeStatePattern": { - "value": "beaker {{volume}}" - }, - "qualitativeSoluteAmountStatePattern": { - "value": "{{soluteAmount}} {{solute}}" + "quantitative": { + "_comment": "for aria-valuetext and alerts", + "solutionVolumeAndUnitPattern": { + "value": "{{volume}} liters" + }, + "hasVolumePattern": { + "value": "has {{volume}} liters" + }, + "soluteAmountAndUnitPattern": { + "value": "{{soluteAmount}} moles" + }, + "saturatedValueTextPattern": { + "value": "{{solidsChange}}. {{stillSaturatedClause}}" + }, + "concentrationStatePattern": { + "value": "concentration {{concentration}}" + }, + "concentrationAndUnit": { + "value": "{{concentration}} molar" + }, + "sliderAlertPattern": { + "value": "{{concentrationChange}} at {{concentration}}. {{colorChange}}." + } }, - "qualitativeConcentrationStateClausePattern": { - "value": ", {{concentration}}" + "qualitative": { + "_comment": "for aria-valuetext and alerts", + "saturatedValueTextPattern": { + "value": "{{propertyAmountChange}}, {{solidsChange}}. {{stillSaturatedClause}}" + }, + "volumeStatePattern": { + "value": "beaker {{volume}}" + }, + "soluteAmountStatePattern": { + "value": "{{soluteAmount}} {{solute}}" + }, + "concentrationStateClausePattern": { + "value": ", {{concentration}}" + }, + "sliderAlertPattern": { + "value": "{{quantityChange}}. {{colorChange}}{{stateInfo}}." + } }, - "_comment6": " ///////////////////////// ALERT STRINGS /////////////////////////////// // No solute alert", "noSoluteAlert": { "value": "Zero concentration. Solution pure water." }, - "_comment7": "// Slider alert patters", - "quantitativeSliderAlertPattern": { - "value": "{{concentrationChange}} at {{concentration}}. {{colorChange}}." - }, - "qualitativeSliderAlertPattern": { - "value": "{{quantityChange}}. {{colorChange}}{{stateInfo}}." - }, - "_comment7": "// Quantity change patterns", - "volumeChangePattern": { - "value": "{{moreLess}} solution" - }, - "soluteAmountChangedPattern": { - "value": "{{moreLess}} solute" - }, - "concentrationChangePattern": { - "value": "{{moreLess}} concentrated" - }, - "colorChangePattern": { - "value": "Solution {{lighterDarker}}" - }, - "lighter": { - "value": "lighter" - }, - "darker": { - "value": "darker" + "quantityChange": { + "volumeChangePattern": { + "value": "{{moreLess}} solution" + }, + "soluteAmountChangedPattern": { + "value": "{{moreLess}} solute" + }, + "concentrationChangePattern": { + "value": "{{moreLess}} concentrated" + }, + "colorChangePattern": { + "value": "Solution {{lighterDarker}}" + }, + "lighter": { + "value": "lighter" + }, + "darker": { + "value": "darker" + } }, - "_comment7": "// Solute changed alert string", "soluteChangedUnsaturatedAlertPattern": { "value": "{{color}} solution, {{concentrationClause}}." }, @@ -299,7 +303,6 @@ "noSoluteAlertQualitative": { "value": "Clear solution, pure water with no solute." }, - "_comment7": " // New saturation state alerts", "atMaxConcentrationPattern": { "value": "at {{concentration}}" }, @@ -315,7 +318,6 @@ "saturationLostQuantitativeAlertPattern": { "value": "No longer saturated at {{concentration}}. Solution lighter." }, - "_comment7": " // Saturated solution alert strings", "stillSaturatedAlertPattern": { "value": "Saturated {{withSolids}} {{maxConcentration}}." },