diff --git a/js/ISLCA11yStrings.js b/js/ISLCA11yStrings.js index 5e68cc1..c28a097 100644 --- a/js/ISLCA11yStrings.js +++ b/js/ISLCA11yStrings.js @@ -33,8 +33,11 @@ define( require => { quantitativeAndQualitativePattern: { value: '{{qualitativeClause}}{{quantitativeClause}}.' }, + qualitativeDistanceEachOtherPattern: { + value: '{{qualitativeDistance}} each other' + }, distanceAndValueSummaryPattern: { - value: '{{object1Label}} and {{object2Label}} are {{qualitativeDistance}} each other' + value: '{{object1Label}} and {{object2Label}} are {{qualitativeDistanceFromEachOther}}' }, centersOfObjectsDistancePattern: { value: 'Centers of {{objectsDistanceClause}}' diff --git a/js/view/describers/PositionDescriber.js b/js/view/describers/PositionDescriber.js index df583bb..704958a 100644 --- a/js/view/describers/PositionDescriber.js +++ b/js/view/describers/PositionDescriber.js @@ -16,6 +16,7 @@ define( require => { const objectLabelPositionPatternString = ISLCA11yStrings.objectLabelPositionPattern.value; // [object] position const distanceAndValueSummaryPatternString = ISLCA11yStrings.distanceAndValueSummaryPattern.value; + const qualitativeDistanceEachOtherPatternString = ISLCA11yStrings.qualitativeDistanceEachOtherPattern.value; const centersExactlyPatternString = ISLCA11yStrings.centersExactlyPattern.value; const quantitativeAndQualitativePatternString = ISLCA11yStrings.quantitativeAndQualitativePattern.value; const centersOfObjectsDistancePatternString = ISLCA11yStrings.centersOfObjectsDistancePattern.value; @@ -141,6 +142,17 @@ define( require => { ); } + /** + * Like "close to each other" or "far from each other" + * @protected + * @returns {string} + */ + getQualitativeDistanceFromEachOther() { + return StringUtils.fillIn( qualitativeDistanceEachOtherPatternString, { + qualitativeDistance: this.qualitativeRelativeDistance() + } ); + } + /** * Returns the string used in the screen summary item displaying position/distance information: * '{{object1Label}} and {{object2Label}} are {{qualitativeDistance}} each other, centers exactly {{distance}} {{units}} apart.' @@ -157,7 +169,7 @@ define( require => { { object1Label: object1Label, object2Label: object2Label, - qualitativeDistance: this.qualitativeRelativeDistance() + qualitativeDistanceFromEachOther: this.getQualitativeDistanceFromEachOther() } ); const quantitativeDistanceClause = StringUtils.fillIn( @@ -181,7 +193,7 @@ define( require => { } /** - * @private + * @protected * @returns {string} */ getDistanceAndUnits() {