Skip to main content

Quality Check tool

The Quality Check tool compares each block's source with its translation in the language --target-lang names, and reports what it finds. --mode selects how:

  • rules, the default, runs deterministic checks locally. They cover empty and identical targets, whitespace, doubled words, inline codes, span constraints, characters, length, and, when enabled, consistency across the run.
  • ai sends each translated block's source and translation to the provider --provider names, which reviews the dimensions in --checks. A hosted provider needs a credential. --provider and --model apply only in this mode.

The tool reads a file that holds both languages, such as XLIFF, or a source file with its translation passed as --target <file>. Findings print on standard output as a table, or as a JSON report with --json. The run writes no file unless -o or --output-dir names one. Each finding is marked as failing or reported, and the run exits 0 whatever it finds. It exits 4 when it compared no translation and reported nothing.

IDqa
SourceBuilt-in
CategoryQuality
Cardinalitybilingual
Requirestarget-language, credentials
Tagsquality, languages

Parameters

ParameterTypeDefaultDescription
absoluteMaxCharLengthinteger255Maximum number of characters allowed in any target segment
apiKeystringAPI key for the AI provider
charsetstringISO-8859-1Name of the character set encoding to check against (e.g. ISO-8859-1)
checkAbsoluteMaxCharLengthbooleanfalseFlag target segments that exceed an absolute character count limit
checkCharsetbooleanfalseWarn if a target character is not included in the specified character set encoding
checkCodeDifferencebooleantrueVerify that target segments have the same inline codes as source segments
checkCorruptedCharactersbooleantrueCheck for patterns indicating encoding corruption (mojibake
checkDoubledWordbooleantrueCheck for consecutive repeated words in target text
checkDoubleSpacesbooleantrueCheck for double spaces in target text
checkEmptySourcebooleantrueCheck for non-empty target when source is empty
checkEmptyTargetbooleantrueCheck for empty target when source has content
checkLeadingWhitespacebooleantrueCheck for leading whitespace mismatches between source and target
checkMaxCharLengthbooleantrueFlag targets longer than a percentage of source character length
checkMaxWordsbooleanfalseFlag target segments that exceed an absolute limit on the number of words
checkMinCharLengthbooleantrueFlag targets shorter than a percentage of source character length
checkPatternsbooleantrueVerify that source patterns have expected corresponding content in the target
checksstring[]Quality checks to perform (e.g. terminology fluency accuracy consistency)
checkSourceInconsistencybooleanfalseFlag when different source texts share the same translation
checkSpanConstraintsbooleantrueCheck non-deletable and non-cloneable span constraint violations
checkTargetInconsistencybooleanfalseFlag when the same source text is translated differently across the run
checkTargetSameAsSourcebooleantrueCheck when target text is identical to source text
checkTrailingWhitespacebooleantrueCheck for trailing whitespace mismatches between source and target
consistencyCaseSensitivebooleantrueWhether consistency comparison is case-sensitive
doubledWordExceptionsstringsie;vous;nousSemicolon-separated list of words allowed to repeat (e.g. sie;vous;nous)
forbiddenCharsstringCharacters that must not appear in target text (e.g. {}[])
maxCharLengthAboveinteger200Maximum allowed percentage of source length for long text
maxCharLengthBelowinteger350Maximum allowed percentage of source length for short text
maxCharLengthBreakinteger20Character count above which text is considered long for the maximum length check
maxWordsinteger0Maximum number of words allowed in any target segment
minCharLengthAboveinteger45Minimum required percentage of source length for long text
minCharLengthBelowinteger30Minimum required percentage of source length for short text
minCharLengthBreakinteger20Character count above which text is considered long for the minimum length check
modestringrulesHow to check quality: deterministic local rules, or an AI provider's review
modelstringAI model name
providerstringanthropicAI provider
requiredCharsstringCharacters that must appear in target if present in source (e.g. punctuation)
strictCodeOrderbooleanfalseFlag differences when codes appear in a different order between source and target
targetSameAsSourceWithCodesbooleantrueInclude inline codes when comparing source and target for identity
targetSameAsSourceWithNumbersbooleantrueInclude number-only segments in same-as-source comparison

Configure it live

Configuration
Loading form…

Examples

Inline-code and whitespace checks only

Focus on code preservation and whitespace, disabling the length-ratio checks.

checkCodeDifference: true
checkLeadingWhitespace: true
checkTrailingWhitespace: true
checkMaxCharLength: false
checkMinCharLength: false

Enforce an absolute character cap

Report any target longer than 200 characters.

checkAbsoluteMaxCharLength: true
absoluteMaxCharLength: 200

Review with an AI provider

Ask the provider to review fluency and accuracy.

mode: ai
provider: anthropic
checks: [fluency, accuracy]

Processing notes

  • Operates on translatable blocks; non-translatable structure passes through unchanged.

  • When a block has no translation in the target language, only the empty-target check applies.

  • Findings are recorded on the block as a findings annotation, which kapi exec qa prints as its report.

  • The consistency checks compare each block with the blocks before it in the same run.

Limitations

  • Length and ratio checks compare character lengths only when source and target are both non-empty.

  • The regex pattern pairs used by checkPatterns are supplied programmatically, not as schema parameters.

  • Requires a target language. The tool compares translations in that one language per run.

  • Run on a translation file alone, the rules mode reads each block as untranslated and reports it as an empty target. Name the source file and pass the translation with --target.

  • A run with --target pairs one source file with one translation and refuses -o and --output-dir.

← Back to the Tool Reference