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.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
correctComma | boolean | true | Correct whitespace after commas |
correctExclamation | boolean | true | Correct whitespace after exclamation marks |
correctFullStop | boolean | true | Correct whitespace after full stops (periods) |
correctQuestion | boolean | true | Correct whitespace after question marks |
includeHorizontalWS | boolean | true | Include horizontal tab characters in corrections |
includeVerticalWS | boolean | true | Include vertical whitespace (line feeds and carriage returns) in corrections |
matchSourceWhitespace | boolean | true | Copy source leading/trailing whitespace to target |
normalizeSpaces | boolean | true | Collapse multiple spaces to a single space |
removeZeroWidthChars | boolean | true | Remove zero-width spaces and joiners |
targetLocale | string | Target locale for processing | |
trimLeading | boolean | false | Remove leading whitespace from target text |
trimTrailing | boolean | false | Remove 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