YAML format (.yaml, .yml)
The YAML format reads YAML documents, extracts scalar string values as translatable blocks, and writes the translations back while preserving the surrounding structure, comments, and ordering. It suits Rails locale files, application configuration, and other key/value catalogues expressed in YAML.
By default only string scalars are extracted. You can also extract non-string scalars, restrict extraction to specific key paths with glob-style patterns, detect inline codes, and route values containing embedded markup (such as HTML) to a subfilter.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
codeFinderRules | array | Regex patterns that match inline codes within translatable text | |
extractNonStrings | boolean | false | Extract non-string scalar values (booleans, numbers, nulls) as translatable blocks |
keyPathPatterns | array | When non-empty, only keys matching one of these glob patterns are extracted. Supports * (single key) and ** (any depth). | |
subfilter | string | Sub-filter to apply to scalar values (e.g., 'html' to process HTML within YAML values) | |
useCodeFinder | boolean | false | Enable regex-based inline code detection within string values |
Configure these parameters interactively and copy the YAML on the Format Reference.
Examples
Extract a single locale subtree
Translate only the keys under the en branch of a Rails-style locale file.
keyPathPatterns: - "en.**"
HTML inside values
Parse HTML markup within YAML scalar values.
subfilter: html
Processing notes
Document structure, key order, and comments are preserved across the read/write roundtrip.
Limitations
Only scalar values are translatable; mapping keys and sequence structure form the non-translatable skeleton.
← Back to the Format Reference