Translate a YAML file or Rails en.yml with comments, keys and quotes kept
Upload a YAML file, such as a Rails en.yml, a Symfony messages file or a Hugo data file, and get it back with the values translated and everything else as you wrote it: comments, key order, indentation and quoting style. A Rails file with en: at the root comes back as fr.yml with fr: at the root. A file of up to 300 values is free in full; bigger files are $5, paid once.
- Values only: keys, comments, indentation and anchors stay as they are
- Plain, "double-quoted", 'single-quoted' and block (| and >) values are translated in their own style
- Rails: the root key en: becomes fr:, and en.yml comes back as fr.yml
- Interpolations such as %{count} and %{name} are checked in every value
- Up to 50,000 values for $5; Unlimited up to 200,000 values
A chatbot and this tool on a YAML file
A chatbot handles a few YAML lines well. Long files and the small details of YAML syntax are where problems appear.
| Your situation | A chatbot | This tool |
|---|---|---|
| Ten lines of strings | Usually translates them correctly | Translates them too |
| A long en.yml with comments | Rewrites the file; comments and quoting are often lost | Changes only the values; comments stay |
| A translation that contains a colon | Can write it unquoted, which breaks the file | Adds quotes when the value needs them |
| %{count} items | Usually keeps it, but nothing checks | Checks it in every value |
How the file is handled
The file is read line by line and never reformatted. For each value the tool knows where it starts and ends on its line, so only those characters change. A plain value that becomes "Panier : contenu" in French gets quotes, because an unquoted colon followed by a space would change its meaning in YAML; a value that was single-quoted stays single-quoted, with apostrophes doubled.
Block text after | or > keeps its indentation, line by line. Keys under identifier names (id, url, slug, type, status, code and similar) and values that look like identifiers, such as cart_path, are left alone, as are true, false, null and numbers.
What is left as it is
Flow-style values ([a, b] or {a: b}), aliases and anchors (*name, &name), tagged values and plain values that continue over several lines without a block marker are not translated, so they cannot be broken. They are rare in translation files.
If your YAML holds app strings with plural forms for a framework that reads them from separate keys, this tool translates each form as a value. For gettext PO, i18next or ARB files with plural rules, use Translate Localization Files.
How the tool works, what it costs and how your files are handled is on the Translate JSON, XML and YAML page; prices for every tool are on the pricing page.
Last updated
Questions and answers
Can I translate a Rails en.yml file?
Yes. Every value is translated, keys and comments stay, %{count}-style interpolations are checked, and the root key en: is renamed to the target language, with the file named accordingly.
Will my comments survive?
Yes. Comments, blank lines and indentation are copied from your file unchanged; only the values are replaced.
What if a translation needs quotes?
Values that would change meaning without quotes, such as text with a colon and a space, are written in double quotes.
How much does it cost?
A file of up to 300 values is free in full. Bigger files are $5, paid once, for up to 50,000 values.
Is my file private?
Only you can open your job. The values are sent to an AI model provider for the sole purpose of translating them, through routes that do not use your data for training. Jobs uploaded without an account are deleted after 7 days.