Skip to content

Commit e72c623

Browse files
authored
Merge pull request #20761 from Yoast/inclusive/improve-normal-abnormal
Inclusive language: Improves the feedback for 'normal' and 'abnormal'
2 parents a7f83d2 + 7b35041 commit e72c623

File tree

4 files changed

+66
-56
lines changed

4 files changed

+66
-56
lines changed

packages/yoastseo/spec/scoring/assessments/inclusiveLanguage/configuration/otherAssessmentsSpec.js

+33-49
Original file line numberDiff line numberDiff line change
@@ -27,51 +27,37 @@ describe( "Checks various conditions for the 'normal' and 'abnormal' assessments
2727
},
2828
{
2929
identifier: "normal",
30-
text: "This isn't normal behaviour children.",
31-
expectedFeedback: "Avoid using <i>normal</i> as it is potentially harmful. " +
32-
"Consider using an alternative, such as <i>typical</i> or a specific characteristic or experience if it is known. " +
33-
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
34-
expectedScore: 3,
35-
},
36-
{
37-
identifier: "normal",
38-
text: "This isn't normal behavior children.",
30+
text: "He is a mentally normal person.",
3931
expectedFeedback: "Avoid using <i>normal</i> as it is potentially harmful. " +
4032
"Consider using an alternative, such as <i>typical</i> or a specific characteristic or experience if it is known. " +
4133
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
4234
expectedScore: 3,
4335
},
4436
{
4537
identifier: "normal",
46-
text: "He is a mentally normal person.",
38+
text: "I'm afraid this isn't psychologically normal.",
4739
expectedFeedback: "Avoid using <i>normal</i> as it is potentially harmful. " +
4840
"Consider using an alternative, such as <i>typical</i> or a specific characteristic or experience if it is known. " +
4941
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
5042
expectedScore: 3,
5143
},
5244
{
53-
identifier: "normal",
45+
identifier: "behaviorallyNormal",
5446
text: "I'm afraid this isn't behaviorally normal.",
55-
expectedFeedback: "Avoid using <i>normal</i> as it is potentially harmful. " +
56-
"Consider using an alternative, such as <i>typical</i> or a specific characteristic or experience if it is known. " +
47+
expectedFeedback: "Be careful when using <i>behaviorally normal</i> as it is potentially harmful. " +
48+
"Unless you are referring to objects or animals, consider using an alternative, such as <i>showing typical behavior</i> " +
49+
"or a specific characteristic or experience if it is known. " +
5750
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
58-
expectedScore: 3,
51+
expectedScore: 6,
5952
},
6053
{
61-
identifier: "normal",
54+
identifier: "behaviorallyNormal",
6255
text: "I'm afraid this isn't behaviourally normal.",
63-
expectedFeedback: "Avoid using <i>normal</i> as it is potentially harmful. " +
64-
"Consider using an alternative, such as <i>typical</i> or a specific characteristic or experience if it is known. " +
56+
expectedFeedback: "Be careful when using <i>behaviourally normal</i> as it is potentially harmful. " +
57+
"Unless you are referring to objects or animals, consider using an alternative, such as <i>showing typical behavior</i> " +
58+
"or a specific characteristic or experience if it is known. " +
6559
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
66-
expectedScore: 3,
67-
},
68-
{
69-
identifier: "normal",
70-
text: "I'm afraid this isn't psychologically normal.",
71-
expectedFeedback: "Avoid using <i>normal</i> as it is potentially harmful. " +
72-
"Consider using an alternative, such as <i>typical</i> or a specific characteristic or experience if it is known. " +
73-
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
74-
expectedScore: 3,
60+
expectedScore: 6,
7561
},
7662
];
7763
testInclusiveLanguageAssessments( testData );
@@ -96,51 +82,49 @@ describe( "Checks various conditions for the 'normal' and 'abnormal' assessments
9682
},
9783
{
9884
identifier: "abnormal",
99-
text: "This isn't abnormal behaviour.",
100-
expectedFeedback: "Avoid using <i>abnormal</i> as it is potentially harmful. " +
101-
"Consider using an alternative, such as <i>atypical</i> or a specific characteristic or experience if it is known. " +
102-
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
103-
expectedScore: 3,
104-
},
105-
{
106-
identifier: "abnormal",
107-
text: "This isn't abnormal behavior.",
85+
text: "He is a mentally abnormal person.",
10886
expectedFeedback: "Avoid using <i>abnormal</i> as it is potentially harmful. " +
10987
"Consider using an alternative, such as <i>atypical</i> or a specific characteristic or experience if it is known. " +
11088
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
11189
expectedScore: 3,
11290
},
11391
{
11492
identifier: "abnormal",
115-
text: "He is a mentally abnormal person.",
93+
text: "I'm afraid this isn't psychologically abnormal.",
11694
expectedFeedback: "Avoid using <i>abnormal</i> as it is potentially harmful. " +
11795
"Consider using an alternative, such as <i>atypical</i> or a specific characteristic or experience if it is known. " +
11896
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
11997
expectedScore: 3,
12098
},
12199
{
122-
identifier: "abnormal",
100+
identifier: "behaviorallyAbnormal",
123101
text: "I'm afraid this isn't behaviorally abnormal.",
124-
expectedFeedback: "Avoid using <i>abnormal</i> as it is potentially harmful. " +
125-
"Consider using an alternative, such as <i>atypical</i> or a specific characteristic or experience if it is known. " +
102+
expectedFeedback: "Be careful when using <i>behaviorally abnormal</i> as it is potentially harmful. " +
103+
"Unless you are referring to objects or animals, consider using an alternative, " +
104+
"such as <i>showing atypical behavior, showing dysfunctional behavior</i> " +
105+
"or a specific characteristic or experience if it is known. " +
126106
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
127-
expectedScore: 3,
107+
expectedScore: 6,
128108
},
129109
{
130-
identifier: "abnormal",
110+
identifier: "behaviorallyAbnormal",
131111
text: "I'm afraid this isn't behaviourally abnormal.",
132-
expectedFeedback: "Avoid using <i>abnormal</i> as it is potentially harmful. " +
133-
"Consider using an alternative, such as <i>atypical</i> or a specific characteristic or experience if it is known. " +
112+
expectedFeedback: "Be careful when using <i>behaviourally abnormal</i> as it is potentially harmful. " +
113+
"Unless you are referring to objects or animals, consider using an alternative, " +
114+
"such as <i>showing atypical behavior, showing dysfunctional behavior</i> " +
115+
"or a specific characteristic or experience if it is known. " +
134116
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
135-
expectedScore: 3,
117+
expectedScore: 6,
136118
},
137119
{
138-
identifier: "abnormal",
139-
text: "I'm afraid this isn't psychologically abnormal.",
140-
expectedFeedback: "Avoid using <i>abnormal</i> as it is potentially harmful. " +
141-
"Consider using an alternative, such as <i>atypical</i> or a specific characteristic or experience if it is known. " +
120+
identifier: "abnormalBehavior",
121+
text: "This isn't abnormal behaviour.",
122+
expectedFeedback: "Be careful when using <i>abnormal behaviour</i> as it is potentially harmful. " +
123+
"Unless you are referring to objects or animals, consider using an alternative, " +
124+
"such as <i>atypical behavior, unusual behavior</i> " +
125+
"or a specific characteristic or experience if it is known. " +
142126
"<a href='https://yoa.st/inclusive-language-other' target='_blank'>Learn more.</a>",
143-
expectedScore: 3,
127+
expectedScore: 6,
144128
},
145129
];
146130
testInclusiveLanguageAssessments( testData );

packages/yoastseo/src/scoring/assessments/inclusiveLanguage/configuration/cultureAssessments.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
potentiallyHarmfulUnless,
77
harmfulNonInclusive,
88
harmfulPotentiallyNonInclusive,
9+
potentiallyHarmfulUnlessAnimalsObjects,
910
} from "./feedbackStrings";
1011

1112
/*
@@ -112,8 +113,7 @@ const cultureAssessments = [
112113
nonInclusivePhrases: [ "oriental" ],
113114
inclusiveAlternatives: "<i>Asian</i>. When possible, be more specific (e.g. <i>East Asian</i>)",
114115
score: SCORES.POTENTIALLY_NON_INCLUSIVE,
115-
feedbackFormat: harmfulPotentiallyNonInclusive + " Unless you are referring to objects or animals, " +
116-
"consider using an alternative, such as %2$s.",
116+
feedbackFormat: potentiallyHarmfulUnlessAnimalsObjects,
117117
},
118118
{
119119
identifier: "asianAmerican",

packages/yoastseo/src/scoring/assessments/inclusiveLanguage/configuration/feedbackStrings.js

+4
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,7 @@ export const potentiallyHarmfulUnlessNonInclusive = [ harmfulNonInclusive, alter
5353
* "Alternatively, if talking about a specific person, use their preferred descriptor if known."
5454
*/
5555
export const preferredDescriptorIfKnown = "Alternatively, if talking about a specific person, use their preferred descriptor if known.";
56+
57+
// An additional string to target phrases that are potentially non-inclusive unless referring to animals or objects.
58+
export const potentiallyHarmfulUnlessAnimalsObjects = [ harmfulPotentiallyNonInclusive,
59+
"Unless you are referring to objects or animals, consider using an alternative, such as %2$s." ].join( " " );

packages/yoastseo/src/scoring/assessments/inclusiveLanguage/configuration/otherAssessments.js

+27-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { SCORES } from "./scores";
2+
import { potentiallyHarmfulUnlessAnimalsObjects } from "./feedbackStrings";
23

34
const otherAssessments = [
45
{
@@ -7,26 +8,47 @@ const otherAssessments = [
78
inclusiveAlternatives: [ "<i>marginalized groups</i>", "<i>underrepresented groups</i>", "<i>gender and sexuality minorities</i>" ],
89
score: SCORES.POTENTIALLY_NON_INCLUSIVE,
910
feedbackFormat: "Be careful when using <i>%1$s</i> as it is potentially overgeneralizing. " +
10-
"Consider using an alternative, such as %2$s, %3$s or specific minorities, such as %4$s.",
11+
"Consider using an alternative, such as %2$s, %3$s or specific minorities, such as %4$s.",
1112
},
1213
{
1314
identifier: "normal",
14-
nonInclusivePhrases: [ "normal person", "normal people", "normal behaviour", "normal behavior", "mentally" +
15-
" normal", "behaviorally normal", "behaviourally normal", "psychologically normal" ],
15+
nonInclusivePhrases: [ "normal person", "normal people", "mentally normal", "psychologically normal" ],
1616
inclusiveAlternatives: [ "<i>typical</i>" ],
1717
score: SCORES.NON_INCLUSIVE,
1818
feedbackFormat: "Avoid using <i>normal</i> as it is potentially harmful. " +
1919
"Consider using an alternative, such as %2$s or a specific characteristic or experience if it is known.",
2020
},
21+
{
22+
identifier: "behaviorallyNormal",
23+
nonInclusivePhrases: [ "behaviorally normal", "behaviourally normal" ],
24+
inclusiveAlternatives: [ "<i>showing typical behavior</i> or a specific characteristic or experience if it is known" ],
25+
score: SCORES.POTENTIALLY_NON_INCLUSIVE,
26+
feedbackFormat: potentiallyHarmfulUnlessAnimalsObjects,
27+
},
2128
{
2229
identifier: "abnormal",
23-
nonInclusivePhrases: [ "abnormal person", "abnormal people", "abnormal behaviour", "abnormal behavior", "mentally" +
24-
" abnormal", "behaviorally abnormal", "behaviourally abnormal", "psychologically abnormal" ],
30+
nonInclusivePhrases: [ "abnormal person", "abnormal people", "mentally abnormal", "psychologically abnormal" ],
2531
inclusiveAlternatives: [ "<i>atypical</i>" ],
2632
score: SCORES.NON_INCLUSIVE,
2733
feedbackFormat: "Avoid using <i>abnormal</i> as it is potentially harmful. " +
2834
"Consider using an alternative, such as %2$s or a specific characteristic or experience if it is known.",
2935
},
36+
{
37+
identifier: "behaviorallyAbnormal",
38+
nonInclusivePhrases: [ "behaviorally abnormal", "behaviourally abnormal" ],
39+
inclusiveAlternatives: [ "<i>showing atypical behavior, showing dysfunctional behavior</i> " +
40+
"or a specific characteristic or experience if it is known" ],
41+
score: SCORES.POTENTIALLY_NON_INCLUSIVE,
42+
feedbackFormat: potentiallyHarmfulUnlessAnimalsObjects,
43+
},
44+
{
45+
identifier: "abnormalBehavior",
46+
nonInclusivePhrases: [ "abnormal behavior", "abnormal behaviour" ],
47+
inclusiveAlternatives: [ "<i>atypical behavior, unusual behavior</i> " +
48+
"or a specific characteristic or experience if it is known" ],
49+
score: SCORES.POTENTIALLY_NON_INCLUSIVE,
50+
feedbackFormat: potentiallyHarmfulUnlessAnimalsObjects,
51+
},
3052
];
3153

3254
otherAssessments.forEach( assessment => {

0 commit comments

Comments
 (0)