Gå til hovedinnhold

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.

IDyaml
SourceBuilt-in
Extensions.yaml, .yml
MIME Typesapplication/yaml, text/yaml, application/x-yaml
CapabilitiesRead + Write

Parameters

ParameterTypeDefaultDescription
codeFinderRulesarrayRegex patterns that match inline codes within translatable text
extractNonStringsbooleanfalseExtract non-string scalar values (booleans, numbers, nulls) as translatable blocks
keyPathPatternsarrayWhen non-empty, only keys matching one of these glob patterns are extracted. Supports * (single key) and ** (any depth).
subfilterstringSub-filter to apply to scalar values (e.g., 'html' to process HTML within YAML values)
useCodeFinderbooleanfalseEnable 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