Translate YAML and TOML files
Translate .yaml, .yml and .toml files up to 4 MB into one or several languages. Keys, hierarchy and order stay as they were. Example instructions for Rails, Hugo and config files.
YAML (.yaml, .yml) and TOML (.toml) files are accepted up to 4 MB. Only string values change: keys, nesting levels, tables and key order come back as they went in. Typical uses are Rails and Symfony locale files, static-site content and Hugo i18n tables.
What is translated, and what is left alone
| Translated | Left as it was | |
|---|---|---|
| YAML | String values, including prose in multi-line blocks | Keys, hierarchy, key order, numbers, booleans |
| TOML | String values, each replaced on its own line | Tables, keys, ordering, comments, numbers, dates, paths |
Placeholders such as %{name} (Rails), {name} and %s are protected and kept in the translated string.
What you can ask
One language, with interpolation placeholders and every key kept.
Translate the values into French. Keep %{name} and %{count} unchanged, and do not change any key.
For a YAML file that already has a section per language: several languages in one job.
Fill the empty fr and de sections from the en section.
For a static site: translate the copy and leave the settings.
Translate only the title, description and body fields into Italian. Leave slugs, dates, layouts and URLs unchanged.
For TOML: keeps the keys the templates call.
Translate the strings into Portuguese. Keep every key and table name exactly as it is.
For YAML: returns just the keys that were written.
Translate the values into French and return only the keys you changed.
Leaves the settings alone.
Translate only the messages and labels people read into German. Leave settings, identifiers, paths and numbers untouched.
Good to know
- Several languages in one job. TOML can take several languages: the plan adds a sibling key with a language suffix, such as
hello_fr, next to each original. YAML can take several languages when the file already holds a section for each one (en:,fr:,de:). A typical Rails file with a singleen:root takes one language per upload, and asking for more can fail with a plan that cannot be prepared. Run it once per language: your glossary carries over. - Output filter. Available for YAML (“only the keys you changed”). TOML returns the whole file.
- YAML comments are not kept. The file is read as data and written back as clean YAML: comments are dropped and indentation and quoting are normalised to two spaces. Keep your commented source as the reference. Anchors stay valid, though their names may change.
- TOML comments are kept in the normal case, because each string is replaced on its own line. A value that cannot be placed that way, such as one inside an inline table, makes the file be rewritten in a normalised form and its comments are dropped. The plan says when that applies.
- Ceiling. 4 MB.
Related
- JSON, ARB and JSON Lines and Java, INI, Fluent and PHP for other config and locale formats.
- Markdown for the content next to the config.
- All file formats