Skip to content

Remove unnecessary feedback string variables for gender category in the Inclusive language assessment#23002

Open
hannaw93 wants to merge 3 commits intotrunkfrom
151-reduce-feedback-strings-for-gender
Open

Remove unnecessary feedback string variables for gender category in the Inclusive language assessment#23002
hannaw93 wants to merge 3 commits intotrunkfrom
151-reduce-feedback-strings-for-gender

Conversation

@hannaw93
Copy link
Copy Markdown
Contributor

@hannaw93 hannaw93 commented Feb 17, 2026

Context

  • In the previous version of the code, we had 5 types of feedback string variables for phrases that get an orange score (context-dependent phrases). Since the purpose of the variables orangeExclusionaryUnlessMen, orangeExclusionaryUnlessMenAndWomen, and orangeExclusionaryUnlessUseTheTerm fall under orangeExclusionaryUnless, they were suggested to be removed.

Summary

This PR can be summarized in the following changelog entry:

  • Updates feedback strings for multiples phrases in the gender category of the inclusive language assessment.
  • [yoastseo] Updates feedback strings for multiples phrases in the gender category of the inclusive language assessment.
  • [shopify-seo] Updates feedback strings for multiples phrases in the gender category of the inclusive language assessment.
  • [yoast-doc-extension] Updates feedback strings for multiples phrases in the gender category of the inclusive language assessment.
  • [non-user-facing] Removes unnecessary feedback variables for gender in the inclusive language assessment.

Relevant technical choices:

  • orangeExclusionaryUnlessTwoGenders was also suggested for removal in the issue, but was not removed because there feedback string is useful for this specific case. If we replace orangeExclusionaryUnlessTwoGenders variable with orangeExclusionaryUnless for the phrase "both genders", the feedback string will say "unless the group consists of both genders" instead of "unless the group consists only of two genders.". Since "both" implies there is only two in general, keeping the current version with "two genders" is better. It could be even better to change it from "two genders" to "men and women", but we can keep it as it is for now and see when addressing it in another issue.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Activate Yoast SEO Free
  • Activate the Inclusive language assessment in the settings
  • Add a text of at least 300 words

Phrases with "ladies and gentlemen"

  • Add the phrase "ladies and gentlemen" to the text
  • Confirm that the assessment shows an orange bullet with the following feedback:
    "Be careful when using ladies and gentlemen as it can be exclusionary. Unless you are sure that the group you refer to only consists of ladies and gentlemen, use an alternative, such as everyone, folks, honored guests. Learn more."
    Previous feedback string: "Be careful when using ladies and gentlemen as it can be exclusionary. Unless you are sure that the group you refer to only consists of men and women, use an alternative, such as everyone, folks, honored guests. Learn more."

Phrases with "mothers and fathers"

  • Add the phrase "mothers and fathers" to the text
  • Confirm that the assessment shows an orange bullet with the following feedback:
    "Be careful when using mothers and fathers as it can be exclusionary. Unless you are sure that the group you refer to only consists of mothers and fathers, use an alternative, such as parents. Learn more."
    Previous feedback string: "Be careful when using mothers and fathers as it can be exclusionary. Unless you are sure that the group you refer to only consists of people who use this term, use an alternative, such as parents. Learn more."

Phrases with "fathers and mothers"

  • Add the phrase "fathers and mothers" to the text
  • Confirm that the assessment shows an orange bullet with the following feedback:
    "Be careful when using fathers and mothers as it can be exclusionary. Unless you are sure that the group you refer to only consists of fathers and mothers, use an alternative, such as parents. Learn more."
    Previous feedback string: "Be careful when using fathers and mothers as it can be exclusionary. Unless you are sure that the group you refer to only consists of people who use this term, use an alternative, such as parents. Learn more."

Phrases with "firemen"

  • Add the phrase "firemen"
  • Confirm that the assessment shows an orange bullet with the following feedback:
    "Be careful when using firemen as it can be exclusionary. Unless you are sure that the group you refer to only consists of firemen, use an alternative, such as firefighters. Learn more."
    Previous feedback string: "Be careful when using firemen as it can be exclusionary. Unless you are sure that the group you refer to only consists of men, use an alternative, such as firefighters. Learn more."

Phrases with "policemen"

  • Add the phrase "policemen"
  • Confirm that the assessment shows an orange bullet with the following feedback:
    "Be careful when using policemen as it can be exclusionary. Unless you are sure that the group you refer to only consists of policemen, use an alternative, such as police officers. Learn more."
    Previous feedback string: "Be careful when using policemen as it can be exclusionary. Unless you are sure that the group you refer to only consists of men, use an alternative, such as police officers. Learn more."

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.
  • This PR also affects Yoast SEO for Google Docs. I have added a changelog entry starting with [yoast-doc-extension], added test instructions for Yoast SEO for Google Docs and attached the Google Docs Add-on label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.
  • I have run grunt build:images and commited the results, if my PR introduces new images or SVGs.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes #https://github.com/Yoast/Lingo-AI/issues/14

@coveralls
Copy link
Copy Markdown

coveralls commented Feb 17, 2026

Pull Request Test Coverage Report for Build 43be60e5ae795b3ab8fd11facd6b7a5d3bb77d13

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 188 unchanged lines in 11 files lost coverage.
  • Overall coverage increased (+0.1%) to 53.824%

Files with Coverage Reduction New Missed Lines %
packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js 1 77.92%
packages/js/src/components/contentAnalysis/Results.js 2 0.0%
packages/js/src/general/routes/task-list.js 4 7.41%
packages/js/src/components/contentAnalysis/SeoAnalysis.js 5 0.0%
packages/js/src/general/components/opt-in-container.js 6 5.88%
packages/dashboard-frontend/src/task-list/components/duration.js 7 77.97%
packages/js/src/general/components/task.js 7 6.67%
packages/js/src/general/components/task-list-opt-in-notification.js 23 10.0%
packages/js/src/components/contentAnalysis/ReadabilityAnalysis.js 23 0.0%
packages/dashboard-frontend/src/store/task-list.js 49 48.06%
Totals Coverage Status
Change from base Build dbbbdc397a2289f741d04b3cc3c3a95d8e8da4da: 0.1%
Covered Lines: 33992
Relevant Lines: 63319

💛 - Coveralls

add missing trailing comma
@hannaw93 hannaw93 added changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog Shopify This PR impacts Shopify. technical-debt labels Mar 12, 2026
@hannaw93 hannaw93 changed the title reduce amount of feedback srings for gender Remove unnecessary feedback string variables for gender category in the Inclusive language assessment Mar 23, 2026
@hannaw93 hannaw93 marked this pull request as ready for review March 23, 2026 10:34
@agnieszkaszuba
Copy link
Copy Markdown
Contributor

Code looks good to me, but I think I had a different idea of what the change should be in the issue 😅 (apologies for the unclear issue description...).

The string I proposed was const exclusionaryUnless = "Be careful when using <i>%1$s</i> as it can be exclusionary. Unless you are sure that the group you refer to only consists of %2$s, use an alternative, such as %3$s."; and you can see the second replacement variable is %2$s so it's not the same phrase as %1$s in the first sentence. I think my idea was to have the phrases like 'men and women', 'men' etc. as a replacement variable, so the feedback strings remain the same, but the implementation is different and we don't have several almost identical strings (which is kind of an overkill to be honest 🤦‍♀️ ).

I'm also fine with the approach you went with if you like it, though. My only concern is that it's less clear to me now that the feedback is about gender. For example "Unless you are sure that the group you refer to only consists of firemen, use an alternative, such as firefighters." makes it sounds like, for example, if the group has firemen but also paramedics, you should use 'firefighters' 😅 Which obviously doesn't make sense from context, but it can sound a bit confusing.

@hannaw93
Copy link
Copy Markdown
Contributor Author

hannaw93 commented Apr 21, 2026

Code looks good to me, but I think I had a different idea of what the change should be in the issue 😅 (apologies for the unclear issue description...).

The string I proposed was const exclusionaryUnless = "Be careful when using <i>%1$s</i> as it can be exclusionary. Unless you are sure that the group you refer to only consists of %2$s, use an alternative, such as %3$s."; and you can see the second replacement variable is %2$s so it's not the same phrase as %1$s in the first sentence. I think my idea was to have the phrases like 'men and women', 'men' etc. as a replacement variable, so the feedback strings remain the same, but the implementation is different and we don't have several almost identical strings (which is kind of an overkill to be honest 🤦‍♀️ ).

I'm also fine with the approach you went with if you like it, though. My only concern is that it's less clear to me now that the feedback is about gender. For example "Unless you are sure that the group you refer to only consists of firemen, use an alternative, such as firefighters." makes it sounds like, for example, if the group has firemen but also paramedics, you should use 'firefighters' 😅 Which obviously doesn't make sense from context, but it can sound a bit confusing.

Conclusion from discussion: the goal is that the feedback strings remain exactly the same, and only amount of variables changes. this can be done by creating

  • a new replacement variable for phrases after "consists only of"
  • the new (wider) feedback string variable orangeExclusionaryUnless  that will be used for all "exclusionary unless" cases in gender category
  • removing unnecessary (more specific) gender feedback string variables that fall under the above group

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: enhancement Needs to be included in the 'Enhancements' category in the changelog Shopify This PR impacts Shopify. technical-debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants