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
bin/lingo quality --ai --locale de --prefix yoga.   # one namespace
bin/lingo quality --ai --key yoga.intro --key yoga.outro  # exact keys

Static rules#

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

  • Terminology — cannot vs can not, verb log in vs noun login, click here, doubled please.
  • Clarity — vague words (stuff, things), abbreviations (ASAP, FYI), double spaces.
  • Business tone — sorry, 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: quality.sample_size keys (default 100), drawn from the --prefix scope when given. Keys named with --key are all reviewed. The prompt includes your context, glossary, and the locale's language_guides entry, so the review checks the same style rules the translation followed. 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