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.
Rules
A finding carries one of these rule ids. The family is length, which differs from the check id the code registers.
| Rule | Severity | Reports | Fix |
|---|---|---|---|
length.max-chars-exceeded | major | The block's source text holds more characters than | Shorten the source text, or raise the limit when the ceiling is wrong for this content. |
length.max-words-exceeded | major | The block's source text holds more words than | Shorten the source text, or raise the limit when the ceiling is wrong for this content. |
Flags
| Flag | Values | Description |
|---|---|---|
--max-chars | integer ≥ 0 (default `0`, off) | Reports a block whose source is longer than this many characters. Counted
in runes. Left off by |
--max-words | integer ≥ 0 (default `0`, off) | Reports a block whose source holds more than this many words. Left off by
|
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