From 92e1011111fc2ddbd4643452420a7c5e8e66c664 Mon Sep 17 00:00:00 2001 From: Jesse Date: Wed, 24 Mar 2021 17:59:46 -0400 Subject: [PATCH] self-voicing -> voicing in a11y strings, see https://github.com/phetsims/tasks/issues/1083 --- gravity-force-lab-basics-strings_en.json | 2 +- js/view/DistanceArrowNode.js | 4 +- js/view/GFLBAlertManager.js | 12 +++--- js/view/GFLBMassControl.js | 14 +++---- js/view/GFLBMassNode.js | 8 ++-- js/view/GFLBScreenView.js | 51 +++++++++--------------- 6 files changed, 39 insertions(+), 52 deletions(-) diff --git a/gravity-force-lab-basics-strings_en.json b/gravity-force-lab-basics-strings_en.json index d40f670..64eb370 100644 --- a/gravity-force-lab-basics-strings_en.json +++ b/gravity-force-lab-basics-strings_en.json @@ -83,7 +83,7 @@ "sizeOfForce": { "value": "Size of force" }, - "selfVoicing": { + "voicing": { "verboseCheckedForceValuesCheckboxInteractionHint": { "value": "uncheck to hide newtons" }, diff --git a/js/view/DistanceArrowNode.js b/js/view/DistanceArrowNode.js index b22ea00..1b37607 100644 --- a/js/view/DistanceArrowNode.js +++ b/js/view/DistanceArrowNode.js @@ -23,8 +23,8 @@ import gravityForceLabBasics from '../gravityForceLabBasics.js'; import gravityForceLabBasicsStrings from '../gravityForceLabBasicsStrings.js'; const distanceUnitsPatternString = gravityForceLabBasicsStrings.distanceUnitsPattern; -const selfVoicingLevelsDistanceArrowPatternString = gravityForceLabStrings.a11y.selfVoicing.levels.distanceArrowPattern; -const selfVoicingLevelsMoveSpheresHintString = inverseSquareLawCommonStrings.a11y.selfVoicing.levels.moveSpheresHintString; +const selfVoicingLevelsDistanceArrowPatternString = gravityForceLabStrings.a11y.voicing.levels.distanceArrowPattern; +const selfVoicingLevelsMoveSpheresHintString = inverseSquareLawCommonStrings.a11y.voicing.levels.moveSpheresHintString; // constants const HEAD_WIDTH = 8; diff --git a/js/view/GFLBAlertManager.js b/js/view/GFLBAlertManager.js index 98e7e8b..43e94c0 100644 --- a/js/view/GFLBAlertManager.js +++ b/js/view/GFLBAlertManager.js @@ -16,12 +16,12 @@ import gravityForceLabBasicsStrings from '../gravityForceLabBasicsStrings.js'; const distanceArrowVisibleString = gravityForceLabBasicsStrings.a11y.distanceArrowVisible; const distanceArrowRemovedString = gravityForceLabBasicsStrings.a11y.distanceArrowRemoved; -const selfVoicingForceValuesShownString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.forceValuesShown; -const selfVoicingForceValuesHiddenString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.forceValuesHidden; -const selfVoicingDistanceShownString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.distanceShown; -const selfVoicingDistanceHiddenString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.distanceHidden; -const selfVoicingConstantSizeSetString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.constantSizeSet; -const selfVoicingConstantSizeOffString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.constantSizeOff; +const selfVoicingForceValuesShownString = gravityForceLabBasicsStrings.a11y.voicing.levels.forceValuesShown; +const selfVoicingForceValuesHiddenString = gravityForceLabBasicsStrings.a11y.voicing.levels.forceValuesHidden; +const selfVoicingDistanceShownString = gravityForceLabBasicsStrings.a11y.voicing.levels.distanceShown; +const selfVoicingDistanceHiddenString = gravityForceLabBasicsStrings.a11y.voicing.levels.distanceHidden; +const selfVoicingConstantSizeSetString = gravityForceLabBasicsStrings.a11y.voicing.levels.constantSizeSet; +const selfVoicingConstantSizeOffString = gravityForceLabBasicsStrings.a11y.voicing.levels.constantSizeOff; class GFLBAlertManager extends GravityForceLabAlertManager { diff --git a/js/view/GFLBMassControl.js b/js/view/GFLBMassControl.js index 9b8e6b3..0905ab4 100644 --- a/js/view/GFLBMassControl.js +++ b/js/view/GFLBMassControl.js @@ -24,18 +24,18 @@ import VBox from '../../../scenery/js/nodes/VBox.js'; import Color from '../../../scenery/js/util/Color.js'; import Panel from '../../../sun/js/Panel.js'; import Playable from '../../../tambo/js/Playable.js'; -import SelfVoicingUtterance from '../../../utterance-queue/js/SelfVoicingUtterance.js'; +import VoicingUtterance from '../../../utterance-queue/js/VoicingUtterance.js'; import GFLBConstants from '../GFLBConstants.js'; import gravityForceLabBasics from '../gravityForceLabBasics.js'; import gravityForceLabBasicsStrings from '../gravityForceLabBasicsStrings.js'; const billionKgString = gravityForceLabBasicsStrings.billionKg; -const briefChangeMassHintPatternString = gravityForceLabBasicsStrings.a11y.selfVoicing.briefChangeMassHintPattern; +const briefChangeMassHintPatternString = gravityForceLabBasicsStrings.a11y.voicing.briefChangeMassHintPattern; const massControlsHelpTextBillionsString = gravityForceLabBasicsStrings.a11y.massControlsHelpTextBillions; const massControlsHelpTextDensityBillionsString = gravityForceLabBasicsStrings.a11y.massControlsHelpTextDensityBillions; -const draggableAlertString = sceneryPhetStrings.a11y.selfVoicing.draggableAlert; -const releasedString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.released; -const grabDragHintPatternString = sceneryPhetStrings.a11y.selfVoicing.grabDragHintPattern; +const draggableAlertString = sceneryPhetStrings.a11y.voicing.draggableAlert; +const releasedString = gravityForceLabBasicsStrings.a11y.voicing.levels.released; +const grabDragHintPatternString = sceneryPhetStrings.a11y.voicing.grabDragHintPattern; // constants const MIN_PANEL_WIDTH = 150; @@ -197,7 +197,7 @@ class GFLBMassControl extends Panel { }; numberPicker.swipeEnd = ( event, listener ) => { - const releasedUtterance = new SelfVoicingUtterance( { + const releasedUtterance = new VoicingUtterance( { alert: releasedString, cancelOther: false } ); @@ -246,7 +246,7 @@ class GFLBMassControl extends Panel { // read new value - note that this gets overridden by a different alert in GravityForceLabAlertManager // if the change in value pushes the other object away, with the positionChangedFromSecondarySourceEmitter - const selfVoicingUtterance = new SelfVoicingUtterance(); + const selfVoicingUtterance = new VoicingUtterance(); valueProperty.lazyLink( ( value, oldValue ) => { const valueText = numberPicker.ariaValueText; diff --git a/js/view/GFLBMassNode.js b/js/view/GFLBMassNode.js index 5777fbf..dc837cd 100644 --- a/js/view/GFLBMassNode.js +++ b/js/view/GFLBMassNode.js @@ -12,7 +12,7 @@ import StringUtils from '../../../phetcommon/js/util/StringUtils.js'; import levelSpeakerModel from '../../../scenery-phet/js/accessibility/speaker/levelSpeakerModel.js'; import sceneryPhetStrings from '../../../scenery-phet/js/sceneryPhetStrings.js'; import Tandem from '../../../tandem/js/Tandem.js'; -import SelfVoicingUtterance from '../../../utterance-queue/js/SelfVoicingUtterance.js'; +import VoicingUtterance from '../../../utterance-queue/js/VoicingUtterance.js'; import GFLBConstants from '../GFLBConstants.js'; import gravityForceLabBasics from '../gravityForceLabBasics.js'; import gravityForceLabBasicsStrings from '../gravityForceLabBasicsStrings.js'; @@ -20,8 +20,8 @@ import gravityForceLabBasicsStrings from '../gravityForceLabBasicsStrings.js'; // constants const MASS_NODE_Y_POSITION = 215; -const releasedString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.released; -const grabDragHintPatternString = sceneryPhetStrings.a11y.selfVoicing.grabDragHintPattern; +const releasedString = gravityForceLabBasicsStrings.a11y.voicing.levels.released; +const grabDragHintPatternString = sceneryPhetStrings.a11y.voicing.grabDragHintPattern; class GFLBMassNode extends MassNode { @@ -110,7 +110,7 @@ class GFLBMassNode extends MassNode { * @param {SceneryEvent} event */ swipeEnd( event ) { - const releasedUtterance = new SelfVoicingUtterance( { + const releasedUtterance = new VoicingUtterance( { alert: releasedString, cancelOther: false } ); diff --git a/js/view/GFLBScreenView.js b/js/view/GFLBScreenView.js index 2a7cbcd..07cd737 100644 --- a/js/view/GFLBScreenView.js +++ b/js/view/GFLBScreenView.js @@ -28,7 +28,6 @@ import ModelViewTransform2 from '../../../phetcommon/js/view/ModelViewTransform2 import levelSpeakerModel from '../../../scenery-phet/js/accessibility/speaker/levelSpeakerModel.js'; import SelfVoicingInputListener from '../../../scenery-phet/js/accessibility/speaker/SelfVoicingInputListener.js'; import SelfVoicingQuickControl from '../../../scenery-phet/js/accessibility/speaker/SelfVoicingQuickControl.js'; -import speakerHighlighter from '../../../scenery-phet/js/accessibility/speaker/speakerHighlighter.js'; import ResetAllButton from '../../../scenery-phet/js/buttons/ResetAllButton.js'; import sceneryPhetStrings from '../../../scenery-phet/js/sceneryPhetStrings.js'; import PDOMPeer from '../../../scenery/js/accessibility/pdom/PDOMPeer.js'; @@ -43,7 +42,6 @@ import VibrationTestEvent from '../../../tappi/js/tracking/VibrationTestEvent.js import VibrationTestEventRecorder from '../../../tappi/js/tracking/VibrationTestEventRecorder.js'; import VibrationTestInputListener from '../../../tappi/js/tracking/VibrationTestInputListener.js'; import VibrationManageriOS from '../../../tappi/js/VibrationManageriOS.js'; -import tappiDialogController from '../../../tappi/js/view/tappiDialogController.js'; import GFLBConstants from '../GFLBConstants.js'; import gravityForceLabBasics from '../gravityForceLabBasics.js'; import gravityForceLabBasicsStrings from '../gravityForceLabBasicsStrings.js'; @@ -75,32 +73,31 @@ const constantSizeCheckboxHelpTextString = gravityForceLabStrings.a11y.controls. const distanceCheckboxHelpTextString = gravityForceLabBasicsStrings.a11y.distanceCheckboxHelpText; const screenSummaryPlayAreaControlsString = gravityForceLabBasicsStrings.a11y.screenSummary.playAreaControls; const basicsSimStateLabelString = gravityForceLabBasicsStrings.a11y.screenSummary.basicsSimStateLabel; -const verboseCheckedForceValuesCheckboxInteractionHintString = gravityForceLabBasicsStrings.a11y.selfVoicing.verboseCheckedForceValuesCheckboxInteractionHint; -const verboseUncheckedForceValuesCheckboxInteractionHintString = gravityForceLabBasicsStrings.a11y.selfVoicing.verboseUncheckedForceValuesCheckboxInteractionHint; -const verboseUncheckedDistanceCheckboxInteractionHintString = gravityForceLabBasicsStrings.a11y.selfVoicing.verboseUncheckedDistanceCheckboxInteractionHint; -const verboseCheckedDistanceCheckboxInteractionHintString = gravityForceLabBasicsStrings.a11y.selfVoicing.verboseCheckedDistanceCheckboxInteractionHint; -const verboseCheckedConstantSizeCheckboxInteractionHintString = gravityForceLabBasicsStrings.a11y.selfVoicing.verboseCheckedConstantSizeCheckboxInteractionHint; -const verboseUncheckedConstantSizeCheckboxInteractionHintString = gravityForceLabBasicsStrings.a11y.selfVoicing.verboseUncheckedConstantSizeCheckboxInteractionHint; -const selfVoicingResetString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.resetAll; -const selfVoicingResetVerboseString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.resetAllVerbose; -const redColorString = gravityForceLabBasicsStrings.a11y.selfVoicing.redColor; -const blueColorString = gravityForceLabBasicsStrings.a11y.selfVoicing.blueColor; +const verboseCheckedForceValuesCheckboxInteractionHintString = gravityForceLabBasicsStrings.a11y.voicing.verboseCheckedForceValuesCheckboxInteractionHint; +const verboseUncheckedForceValuesCheckboxInteractionHintString = gravityForceLabBasicsStrings.a11y.voicing.verboseUncheckedForceValuesCheckboxInteractionHint; +const verboseUncheckedDistanceCheckboxInteractionHintString = gravityForceLabBasicsStrings.a11y.voicing.verboseUncheckedDistanceCheckboxInteractionHint; +const verboseCheckedDistanceCheckboxInteractionHintString = gravityForceLabBasicsStrings.a11y.voicing.verboseCheckedDistanceCheckboxInteractionHint; +const verboseCheckedConstantSizeCheckboxInteractionHintString = gravityForceLabBasicsStrings.a11y.voicing.verboseCheckedConstantSizeCheckboxInteractionHint; +const verboseUncheckedConstantSizeCheckboxInteractionHintString = gravityForceLabBasicsStrings.a11y.voicing.verboseUncheckedConstantSizeCheckboxInteractionHint; +const selfVoicingResetVerboseString = gravityForceLabBasicsStrings.a11y.voicing.levels.resetAllVerbose; +const redColorString = gravityForceLabBasicsStrings.a11y.voicing.redColor; +const blueColorString = gravityForceLabBasicsStrings.a11y.voicing.blueColor; const resetAllString = sceneryPhetStrings.a11y.resetAll.label; -const detailsPatternString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.detailsPattern; -const overviewPatternString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.overviewPattern; -const screenSummarySingleScreenIntroPatternString = sceneryPhetStrings.a11y.selfVoicing.simSection.screenSummary.singleScreenIntroPattern; +const detailsPatternString = gravityForceLabBasicsStrings.a11y.voicing.levels.detailsPattern; +const overviewPatternString = gravityForceLabBasicsStrings.a11y.voicing.levels.overviewPattern; +const screenSummarySingleScreenIntroPatternString = sceneryPhetStrings.a11y.voicing.simSection.screenSummary.singleScreenIntroPattern; const summaryInteractionHintPatternString = inverseSquareLawCommonStrings.a11y.screenSummary.summaryInteractionHintPattern; const massString = gravityForceLabStrings.a11y.mass; const screenSummaryPlayAreaOverviewPatternString = gravityForceLabBasicsStrings.a11y.screenSummary.playAreaOverviewPattern; const screenSummarySecondaryDescriptionPatternString = gravityForceLabBasicsStrings.a11y.screenSummary.secondaryDescriptionPattern; const thePlayAreaHasString = gravityForceLabBasicsStrings.a11y.screenSummary.thePlayAreaHas; -const thereAreString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.thereAre; +const thereAreString = gravityForceLabBasicsStrings.a11y.voicing.levels.thereAre; const inTheControlAreaString = gravityForceLabBasicsStrings.a11y.screenSummary.inTheControlArea; -const inAdditionString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.inAddition; -const moveMass1HintString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.moveMass1Hint; -const moveMass2HintString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.moveMass2Hint; -const changeMass1HintString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.changeMass1Hint; -const changeMass2HintString = gravityForceLabBasicsStrings.a11y.selfVoicing.levels.changeMass2Hint; +const inAdditionString = gravityForceLabBasicsStrings.a11y.voicing.levels.inAddition; +const moveMass1HintString = gravityForceLabBasicsStrings.a11y.voicing.levels.moveMass1Hint; +const moveMass2HintString = gravityForceLabBasicsStrings.a11y.voicing.levels.moveMass2Hint; +const changeMass1HintString = gravityForceLabBasicsStrings.a11y.voicing.levels.changeMass1Hint; +const changeMass2HintString = gravityForceLabBasicsStrings.a11y.voicing.levels.changeMass2Hint; // constants const MASS_CONTROLS_Y_POSITION = 385; @@ -344,12 +341,7 @@ class GFLBScreenView extends ScreenView { if ( phet.chipper.queryParameters.supportsSelfVoicing ) { phet.joist.sim.voicingUtteranceQueue.enabled = true; - if ( ISLCQueryParameters.selfVoicingVersion === 1 ) { - webSpeaker.speak( selfVoicingResetString ); - } - else { - webSpeaker.speak( selfVoicingResetVerboseString ); - } + phet.joist.sim.voicingUtteranceQueue.addToBack( selfVoicingResetVerboseString ); } }, right: this.layoutBounds.maxX - 10, @@ -402,8 +394,6 @@ class GFLBScreenView extends ScreenView { // self-voicing prototype //------------------------------------------------ if ( phet.chipper.queryParameters.supportsSelfVoicing ) { - webSpeaker.initialize(); - speakerHighlighter.initialize(); // add the swipe listener const swipeListener = new SwipeListener( phet.joist.display._input ); @@ -475,9 +465,6 @@ class GFLBScreenView extends ScreenView { // in this mode, focus just goes from top to bottom, but starting with the quick control // to guide the user to hear details about the simulation first massPositionsNode.pdomOrder = [ selfVoicingQuickControl, mass2Node.selfVoicingWrapper, mass1Node.selfVoicingWrapper, distanceArrowNode.selfVoicingWrapper, null ]; - - // dialogs to enable the feature and introduce custom gestures - tappiDialogController.initialize( selfVoicingQuickControl ); } if ( phet.chipper.queryParameters.vibrationParadigm ) {