Gå til hovedinnhold

Whitespace Correct tool

The Whitespace Correct tool cleans up whitespace in target translations. It can collapse repeated spaces, trim leading and trailing whitespace, match the source's leading/trailing whitespace onto the target, remove zero-width characters, and remove whitespace after specific punctuation marks. The last is particularly useful when translating from a space-delimited language into a non-space-delimited one such as Chinese or Japanese.

The tool operates only on the target text, so a target locale is required, and only blocks that already have a target for that locale are processed.

IDwhitespace-correct
SourceBuilt-in
Categorytext-processing
Cardinalitybilingual
Requirestarget-language
Tagstext-processing

Parameters

ParameterTypeDefaultDescription
correctCommabooleantrueCorrect whitespace after commas
correctExclamationbooleantrueCorrect whitespace after exclamation marks
correctFullStopbooleantrueCorrect whitespace after full stops (periods)
correctQuestionbooleantrueCorrect whitespace after question marks
includeHorizontalWSbooleantrueInclude horizontal tab characters in corrections
includeVerticalWSbooleantrueInclude vertical whitespace (line feeds and carriage returns) in corrections
matchSourceWhitespacebooleantrueCopy source leading/trailing whitespace to target
normalizeSpacesbooleantrueCollapse multiple spaces to a single space
removeZeroWidthCharsbooleantrueRemove zero-width spaces and joiners
targetLocalestringTarget locale for processing
trimLeadingbooleanfalseRemove leading whitespace from target text
trimTrailingbooleanfalseRemove trailing whitespace from target text

Configure these parameters interactively and copy the flow-step YAML on the Tool Reference.

Examples

Normalize spacing for a locale

Apply the default whitespace cleanup to a target.

targetLocale: fr-FR

Tidy CJK punctuation spacing

Remove spaces after punctuation for a non-space-delimited target.

targetLocale: zh-CN
correctFullStop: true
correctComma: true

Processing notes

  • Operates on the target text only; a target locale is required and only existing targets are processed.

  • Punctuation correction removes the whitespace that immediately follows each enabled punctuation mark, limited to the included whitespace types.

← Back to the Tool Reference