Skip to main content

Length Check

The Length Check holds every translatable block's source text to an absolute ceiling: --max-chars for characters and --max-words for words, each reported as length.max-chars-exceeded or length.max-words-exceeded at major severity.

Both are off unless asked for, and a limit of 0 is the way to leave one off. A negative limit is refused rather than ignored, so a typo in a recipe or a script is an error at the point it is written.

Characters are counted as runes, so a limit means the same thing whatever script the content is in, and a word is counted the way the rest of the engine counts words.

The bar is the source text, which is what makes this a source-side check: it answers "is what we wrote short enough", the question a UI string or a push notification has before any translation exists. Whether a translation fits where its source did is a different question, asked by the bilingual qa check, which compares the two.

Checklength-check
Rule familylength.*
SourceBuilt-in

Rules

A finding carries one of these rule ids. The family is length, which differs from the check id the code registers.

RuleSeverityReportsFix
length.max-chars-exceededmajor

The block's source text holds more characters than --max-chars allows. The finding names the limit and the count.

Shorten the source text, or raise the limit when the ceiling is wrong for this content.

length.max-words-exceededmajor

The block's source text holds more words than --max-words allows. The finding names the limit and the count.

Shorten the source text, or raise the limit when the ceiling is wrong for this content.

Flags

FlagValuesDescription
--max-charsinteger ≥ 0 (default `0`, off)

Reports a block whose source is longer than this many characters. Counted in runes. Left off by 0, which is the default.

--max-wordsinteger ≥ 0 (default `0`, off)

Reports a block whose source holds more than this many words. Left off by 0, which is the default.

Processing notes

  • Off unless a limit is given, so an ordinary check run reports nothing from it.

  • Runs over translatable blocks; content a reader surfaces as structure or code is never measured.

  • A negative limit is an error rather than a silently disabled check.

Limitations

  • Measures the source only; it does not compare a translation against its source.

  • An absolute ceiling rather than a ratio; there is no percentage-of-source model here.

  • The limit is one number for the whole run; a per-collection or per-key ceiling is a recipe-level concern.

← Back to the Check Reference