Validation & quality

Quality linting

Catch awkward, informal, or inconsistent copy — statically, and optionally with an AI pass.

Running quality#

quality lints a locale's text (the source locale by default) and prints suggestions grouped by severity. It runs entirely offline unless you pass --ai.

shell
bin/lingo quality                 # lint the source locale
bin/lingo quality --locale de     # lint a target locale
bin/lingo quality --ai            # add an AI review pass

Static rules#

A set of regex rules flags common issues without any model call:

  • Terminologycannot vs can not, verb log in vs noun login, click here, doubled please.
  • Clarity — vague words (stuff, things), abbreviations (ASAP, FYI), double spaces.
  • Business tonesorry, oops, awesome, cool.
  • Accessibility — positional references (see below, above), colour-only meaning.
  • Placeholders — spaces inside %{…}, uppercase placeholder names.

Terminology lists#

quality.terminology selects a built-in list — business (the default) or banking — or a path to your own YAML mapping terms to suggestions (a nil suggestion marks a term as reviewed and acceptable). Flagged terms produce info-level suggestions, e.g. "wire transfer → consider 'bank transfer'".

British spellings#

With quality.british_spellings: true, the source locale is checked for American→British drift (organization → organisation, color → colour, analyze → analyse, …). These are auto-fixable.

The AI pass#

--ai samples the locale and asks your quality.model to suggest improvements for clarity, professionalism, and friendliness, each tagged with a severity. It samples rather than reviewing everything, to keep the cost bounded. Needs provider credentials; without them it warns and skips.

Auto-fixing#

fix-quality rewrites the fixable suggestions — the universal fixes (can not → cannot) and British spellings — back into the locale files, preserving the original case. Preview first with --dry-run.

shell
bin/lingo fix-quality --locale en --dry-run
bin/lingo fix-quality --locale en