Skip to content

Commit

Permalink
self-voicing -> voicing in a11y strings, see phetsims/tasks#1083
Browse files Browse the repository at this point in the history
  • Loading branch information
jessegreenberg committed Mar 24, 2021
1 parent 882b969 commit 92e1011
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 52 deletions.
2 changes: 1 addition & 1 deletion gravity-force-lab-basics-strings_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"sizeOfForce": {
"value": "Size of force"
},
"selfVoicing": {
"voicing": {
"verboseCheckedForceValuesCheckboxInteractionHint": {
"value": "uncheck to hide newtons"
},
Expand Down
4 changes: 2 additions & 2 deletions js/view/DistanceArrowNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions js/view/GFLBAlertManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 7 additions & 7 deletions js/view/GFLBMassControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -197,7 +197,7 @@ class GFLBMassControl extends Panel {
};

numberPicker.swipeEnd = ( event, listener ) => {
const releasedUtterance = new SelfVoicingUtterance( {
const releasedUtterance = new VoicingUtterance( {
alert: releasedString,
cancelOther: false
} );
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions js/view/GFLBMassNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ 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';

// 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 {

Expand Down Expand Up @@ -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
} );
Expand Down
51 changes: 19 additions & 32 deletions js/view/GFLBScreenView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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 ) {
Expand Down

0 comments on commit 92e1011

Please sign in to comment.