Problem
Harper supports multiple English dialects, but the extension always uses the default (American). Non-American spellings such as "colour" and "organisation" are flagged as misspellings, and there is no setting to change the dialect Harper checks against.
Proposed settings
Two new keys under extension.markeditProofreading:
dialect: the English dialect Harper checks against. One of "American" (default), "British", "Australian", "Canadian", or "Indian". Passed to Harper via setDialect, so it controls both which spellings are flagged and which spellings suggestions prefer.
dialectFallbacks: additional dialects whose spellings are also accepted (default []). A Spelling lint from the primary dialect is kept only if every fallback dialect also flags the same word; if any fallback accepts it, it is not flagged. Suggestions always come from the primary dialect.
{
"extension.markeditProofreading": {
"dialect": "Australian",
"dialectFallbacks": ["American"]
}
}
With this config, Australian spellings are suggested for genuine misspellings while American spellings like "color" are accepted rather than flagged. Defaults preserve current behaviour (American, no fallbacks).
Design question: naming
I have named the values to mirror Harper's own Dialect enum (American, British, ...) so the setting matches Harper's docs and avoids inventing a mapping. The alternative is BCP 47 codes (en-US, en-GB, en-AU, ...), which are more familiar but imply locale completeness Harper does not have (no en-NZ, en-IE, etc.). Happy to go either way, or accept the codes as aliases. Which do you prefer?
Notes
I have a branch ready. dialect is a thin pass-through to Harper's setDialect and stands alone; dialectFallbacks is the more opinionated part (it runs one extra lint pass per fallback dialect), so the two can land as separate PRs if you prefer. Will open the PR against whatever approach is agreed here.
Problem
Harper supports multiple English dialects, but the extension always uses the default (American). Non-American spellings such as "colour" and "organisation" are flagged as misspellings, and there is no setting to change the dialect Harper checks against.
Proposed settings
Two new keys under
extension.markeditProofreading:dialect: the English dialect Harper checks against. One of"American"(default),"British","Australian","Canadian", or"Indian". Passed to Harper viasetDialect, so it controls both which spellings are flagged and which spellings suggestions prefer.dialectFallbacks: additional dialects whose spellings are also accepted (default[]). A Spelling lint from the primary dialect is kept only if every fallback dialect also flags the same word; if any fallback accepts it, it is not flagged. Suggestions always come from the primarydialect.{ "extension.markeditProofreading": { "dialect": "Australian", "dialectFallbacks": ["American"] } }With this config, Australian spellings are suggested for genuine misspellings while American spellings like "color" are accepted rather than flagged. Defaults preserve current behaviour (American, no fallbacks).
Design question: naming
I have named the values to mirror Harper's own
Dialectenum (American,British, ...) so the setting matches Harper's docs and avoids inventing a mapping. The alternative is BCP 47 codes (en-US,en-GB,en-AU, ...), which are more familiar but imply locale completeness Harper does not have (noen-NZ,en-IE, etc.). Happy to go either way, or accept the codes as aliases. Which do you prefer?Notes
I have a branch ready.
dialectis a thin pass-through to Harper'ssetDialectand stands alone;dialectFallbacksis the more opinionated part (it runs one extra lint pass per fallback dialect), so the two can land as separate PRs if you prefer. Will open the PR against whatever approach is agreed here.