This task involves the work of introducing a new edit suggestion within the VisualEditor Suggestion Mode that makes people aware when a variety of English is being used within an article that does //not // align with the tag/template associated with said article.
=== Deployment plan
In technical terms, this can be deployed by adding it to the existing configuration on enwiki.
- enwiki already has a configuration for `textmatch`, so the `british-english` section of the configuration file below should be added to `textMatch.matchItems`.
- A user with permission to edit the configuration must make the change.
- To repeat: do not replace the existing configuration wholesale.
- Ensure it's not enabled by default
Process-wise, the fact that this was implemented with `TextMatchEditCheck` as a pure configuration change has surfaced that we do not yet have a decided process around deployments of this type; see comment section for discussion of how we're going forward with this.
=== Meta
- Relevant wish, policy, guideline, template, etc.: [en:MOS:ENGVAR](https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style#National_varieties_of_English)
- Suggestion scope: **en.wiki**
=== Requirements
**Meta**
- Configuration
-- Account: `false`
--- //Specify which account state the edit check should apply to. Valid values are "loggedin", "loggedout", false. The default false results in the edit check applying to all users.//
-- maximumEditcount: `100000`
--- //Specify a threshold for the number of changes at which Edit Check is activated. The default 100 means that the edit check will only be shown to users with 100 edits or fewer. If this value is not defined, the default value is used. The number of edits is based on user edit count, edits from all namespaces are taken into account.//
-- ignoreSectionsminimumEditcount: `[]`
--- //An array of section titles, which will be compared case-insensitively to headings. If a heading matches an item in this array, all content within that section will be ignored for checks.//
-- ignoreLeadSection: `false`
--- //If true, the content of the lead section will be ignored for checks. A lead section is defined as content in an article with at least one heading that precedes the first heading.//
-- Enabled: `true`
--- //If true, the check will be enabled, assuming all other configuration allows it to be shown. If false, the check will not be shown.//
-- Type **Suggestion**
-- inCategory: !!#TODO!!
-- hasTemplate: !!#TODO!!
--- //An array of templates whose presence should cause this check to be offered.//
-- lacksTemplate: !!#TODO!!
--- //An array of templates whose absence should cause this check to be offered.//
- Detection heuristic: !!#TODO!!
- Edit Tag(s): //See T413419//
**User experience**
- Card design
-- Title: **British/American English detected**
-- Description (≤2 sentences): **Consider adjusting this word to [American English](https://en.wikipedia.org/wiki/American_English)/[British English](https://en.wikipedia.org/wiki/British_English) so that it is consistent with how the rest of the article is written. Learn more.**
-- Link to learn more: [MOS:ENGVAR](https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style#National_varieties_of_English)
-- Calls to action
--- {nav Switch}: When tapped, automatically adjust the word in question to use the British/American English equivalent
---- //Note: the above assumes communities will have configured these mappings.//
--- {nav Dismiss}: When tapped, leave the word in question unchanged
-- Success toast: `Thank you for helping to make this article easier for people to read and follow.`
**Instrumentation**
//As with all Edit Checks and Suggestions, we will want to know...//
- Any time a Suggestion of this type is activated within an edit session
- Any time someone views a Suggestion of this type within an edit session
- Any time someone engages with a Suggestion and how they engage with it
**See also**
* https://en.wikipedia.org/wiki/User:Ohconfucius/EngvarB
* https://en.wikipedia.org/wiki/User:Ohconfucius/script/EngvarB.js
**Artifacts**
- [Test page on patchdemo](https://dc375f81da.catalyst.wmcloud.org/wiki/The_Colour_of_Magic?veaction=edit&ecenable=experimental,suggestions)
- [Config on patchdemo](https://dc375f81da.catalyst.wmcloud.org/wiki/MediaWiki:Editcheck-config.json)
{F71571319}
=== Checklists
==== Head of queue
- [ ] File ticket to add toast for `TextMatchEditCheck`
- [ ] Identify if we can include internal links in `TextMatchEditCheck` for the "learn more" link; file ticket if not
==== Any time
- [x] Discuss bringing toasts to the config level for all checks
- Will be filing a ticket. Won't block here, instead considering the toast as part of the toast implementation task
- [ ] Word list community feedback
==== Before deploy
- [ ] ~~Agree a word list with community feedback~~
- [x] Agree when to deploy this config change
- We're going to go ahead, but not enabled by default
- [ ] Check `TextMatchEditCheck` has instrumentation (probably); file ticket if not
- [ ] Update description text to match current description
==== Once ready
- [ ] Deploy the config change
- [ ] Add a note to the core template that if you're redirecting a template to it, also add to the edit check