---
title: "Translate YAML and TOML files"
description: "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."
canonical: "https://ai-glot.com/docs/formats/yaml-and-toml"
updated: "2026-10-12"
---

# Translate YAML and TOML 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.

> **Tip: Try it free**
>
> Drop a file of up to 2 MB on the free translators for [YAML](https://ai-glot.com/file-formats/yaml-translation) or [TOML](https://ai-glot.com/file-formats/toml-translation) to try them with no account, five files a day. The app, the API and the CLI take files up to 4 MB.

## 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

**A Rails locale**

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.

**Fill the language sections**

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.

**Front matter and content**

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.

**A Hugo i18n table**

For TOML: keeps the keys the templates call.

Translate the strings into Portuguese. Keep every key and table name exactly as it is.

**Only the changed keys**

For YAML: returns just the keys that were written.

Translate the values into French and return only the keys you changed.

**User-facing text in a config**

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 single `en:` 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](/docs/platform/glossaries) 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](/docs/formats/json) and [Java, INI, Fluent and PHP](/docs/formats/java-ini-fluent-php) for other config and locale formats.
- [Markdown](/docs/formats/markdown) for the content next to the config.
- [All file formats](/docs/formats)
