YAML Translation
Source Language: en-US (English, United States)
The code of the source language. Example: fr, fr-FR, fil, zh-Hans-CN. Type to search.
Target Language: zh-Hans-CN (Chinese, Simplified Chinese, China)
The code of the target language. Example: en, en-US, fil, zh-Hans-CN. Type to search.
Translate Metadata:
Generate & Save Glossary:
AI translation takes time (up to 5 minutes) as the AI processes your content. This YAML Translation page translates in real-time and does not store your content on our servers. For large YAML files, we recommend using the I18N File Translation page for more reliable delivery. Please do not leave this page until translation is complete.

How to Translate YAML Files Online

Translating YAML localization files is straightforward with our AI-powered tool. Follow these steps to get a fully translated YAML file in minutes:

  1. Paste your .yaml or .yml file content into the editor above.
  2. Set the source language (or leave it blank for auto-detection) and enter the target language code (e.g., es, de, ja, zh).
  3. Click Translate and wait while the AI processes your YAML content. Translation may take up to a few minutes for large files.
  4. Copy the translated output or download it as a .yaml file ready to commit to your repository.

What Is a YAML File?

YAML (YAML Ain't Markup Language) is a human-readable data serialization format widely used for configuration files and localization in modern software development. Its clean, indentation-based syntax makes it easy to read and write compared to JSON or XML.

YAML files use the .yaml or .yml extension and are the standard localization format for Ruby on Rails, Symfony (PHP), Vue i18n, Flutter ARB, Spring Boot, and many other frameworks. A single YAML file typically holds all translated strings for one language.

Because YAML supports nested keys, lists, and inline comments, it is particularly well-suited for organizing large sets of UI strings in a hierarchical structure that mirrors the application's component tree.

YAML File Structure for Localization

A typical YAML localization file uses nested key-value pairs to organize strings by feature or component. Here is an example of a common YAML structure:

# Application configuration
app:
  name: "My Application"
  version: "2.0.0"
  description: "A powerful tool for managing your workflow"

navigation:
  home: "Home"
  about: "About Us"
  contact: "Contact"
  login: "Sign In"
  logout: "Sign Out"

messages:
  welcome: "Welcome back, {{name}}!"
  error: "An unexpected error occurred. Please try again."
  success: "Your changes have been saved successfully."

buttons:
  save: "Save"
  cancel: "Cancel"
  delete: "Delete"
  confirm: "Confirm"
  • Key-value pairs — the foundation of YAML: key: "Translated string".
  • Nested keys — group related strings under a common parent: button.save: "Save".
  • Lists — ordered sequences of values using the - prefix.
  • Comments — lines starting with # provide context for translators and are optionally preserved.
  • Interpolation placeholders — variables like {{name}} or %{count} are preserved as-is and never translated.

YAML Localization File Example

Below is a realistic YAML localization file showing nested keys, interpolation, and comment usage as found in production Rails and Vue i18n projects:

# en/messages.yaml
user:
  greeting: "Hello, {{name}}!"
  farewell: "Goodbye, {{name}}. See you soon!"
  profile:
    title: "Your Profile"
    subtitle: "Manage your account settings"
    avatar: "Profile Picture"

errors:
  notFound: "The page you are looking for does not exist."
  unauthorized: "You are not authorized to view this page."
  serverError: "A server error occurred. Please contact support."

forms:
  required: "This field is required."
  email: "Please enter a valid email address."
  minLength: "Must be at least {{min}} characters."

Our AI translates all string values while leaving keys, interpolation variables, and structural indentation completely unchanged. The result is a drop-in replacement file for your target language.

YAML Files in Software Localization

YAML is one of the most popular formats for software localization because it strikes the right balance between human readability and machine parsability. Developers can edit YAML files directly without special tooling, while automated pipelines can process them reliably.

In a typical localization workflow, you maintain one YAML file per language (e.g., en.yml, de.yml, ja.yml) inside a locales or i18n directory. The source language file is treated as the reference, and translated copies are generated for each target locale.

Frameworks and Tools That Use YAML for Localization

YAML localization files are supported by a wide range of popular frameworks across multiple languages and platforms:

  • Ruby on Rails — uses YAML as its native i18n format (config/locales/en.yml). The Rails i18n gem supports nested keys, pluralization, and interpolation out of the box.
  • Symfony (PHP) — supports YAML translation files alongside XLIFF. YAML files in translations/messages.en.yaml power the Symfony Translation component.
  • Spring Boot (Java) — while Spring typically uses .properties files, the Spring YAML support in application.yml and community libraries like i18n4java extend YAML to localization.
  • Flutter / Dart — the easy_localization package and similar Flutter i18n libraries use YAML files to manage translations for mobile and desktop apps.
  • Vue i18n — the official Vue.js internationalization plugin supports YAML message files. Vite-plugin-vue-i18n allows importing .yaml files directly as Vue components.
  • React / Next.js — libraries such as next-i18next and react-i18next can load YAML translation files through custom backends, making them a popular choice for Next.js localization.

AI Glossary Generation for YAML Translations

Our AI Glossary Generation feature helps you maintain consistent terminology across all your YAML localization files. Enable saving and reusing it by toggling Generate & Save Glossary in the translation options:

  • Consistent terminology — the AI analyzes your source YAML and existing target translations to build a glossary of key terms, ensuring product names, UI labels, and technical terms are translated the same way throughout your app.
  • Domain-specific terms — provide a sample of already-translated YAML content in the target strings field. The AI learns your preferred terminology and applies it to new strings automatically.
  • How to use it — paste your translated YAML content into the optional target strings field that appears when glossary generation is enabled. The AI will extract recurring terms and use them as a translation guide. If no target strings are provided, the AI generates glossary entries from the source content alone, which can still improve consistency.

Why Use L10n.dev for YAML Translation?

  • AI-powered accuracy — our translation engine understands YAML localization context, not just raw text. It translates human-readable strings while ignoring keys, anchors, aliases, and structural syntax.
  • Structure preservation — indentation, nesting, and YAML hierarchy are always preserved. The translated file is a valid YAML document that can be parsed without modification.
  • Interpolation support — placeholders like {{name}}, %{count}, :variable, and ICU message format variables are detected and left untouched during translation.
  • Nested key awareness — the AI understands the hierarchical structure of deeply nested YAML files and maintains accurate context for each string based on its position in the tree.
  • Multi-framework compatibility — output is compatible with Ruby on Rails, Symfony, Vue i18n, Flutter, Spring Boot, and any other framework that consumes standard YAML localization files.
  • Translate up to 30,000 characters for free. Paid plans offer scalable pricing for larger projects. View Pricing
  • Optimized for large files — for very large YAML files (hundreds of kilobytes), use the I18N File Translation page which supports file uploads up to 5 MB.

Common YAML Translation Use Cases

YAML translation is used across a wide range of application types and development workflows:

  • Ruby on Rails apps — translate config/locales/en.yml into additional language files for multilingual Rails applications.
  • Symfony PHP projects — localize translations/messages.en.yaml and domain-specific translation files for Symfony-based websites and APIs.
  • Vue.js / Nuxt.js apps — translate Vue i18n YAML message files to add language support to Vue single-page applications and Nuxt.js static sites.
  • Flutter mobile apps — translate assets/lang/en.yaml localization files for cross-platform Flutter apps targeting multiple markets.
  • Configuration and CMS content — translate YAML configuration files used by static site generators like Jekyll, Hugo, or Gatsby for multi-language site content.
  • Static site generators — Jekyll uses _data/ YAML files for site-wide strings, Hugo uses i18n/ YAML files, and Gatsby supports YAML via gatsby-plugin-react-i18next.
  • CI/CD and DevOps pipelines — integrate YAML translation into your deployment pipeline using the L10n.dev REST API to automate localization as part of your release workflow.

YAML vs JSON for Localization

Both YAML and JSON are widely used for localization files, but they have different strengths. YAML's human-readable syntax, support for comments, and compact multiline strings make it preferred in communities like Ruby and PHP where developers frequently edit translation files by hand.

JSON is more universally supported across JavaScript ecosystems (React, Angular, Vue) and is easier to parse programmatically. If your project uses both formats, L10n.dev supports both — you can translate JSON files on the JSON Translation page and YAML files here.

For most projects the choice of format is dictated by the framework you use. If you use Rails, Symfony, or Vue i18n, YAML is the natural choice. If you use Angular i18next, React i18next, or Next.js, JSON is more common. L10n.dev handles both equally well.

Frequently Asked Questions

What parts of my YAML file are preserved during translation?

All YAML structural elements are preserved: keys, indentation, nesting, anchors (&), aliases (*), comments (#), and list syntax (-). Interpolation placeholders like {{variable}}, %{name}, and :symbol are always left unchanged. Only the human-readable string values are translated.

Are interpolation variables and placeholders safe during translation?

Yes. Our AI detects common interpolation patterns used by Rails (%{name}), Vue i18n ({name}), Symfony (%variable%), Flutter ({name}), and ICU message format. These variables are preserved exactly as written and are never translated or modified.

How do I translate a YAML file?

Paste your .yaml or .yml file content into the editor above, set the target language code (e.g., fr, de, ja, zh), and click Translate. The AI returns a fully translated YAML file with all keys and structure preserved. Download the result as a .yaml file.

How does AI Glossary Generation help with YAML translation?

Enabling Generate & Save Glossary allows you to paste existing translated YAML content alongside your source file. The AI extracts recurring terms and uses them as a translation guide, ensuring product names, feature labels, and domain terms are translated consistently throughout the file and across future translations.

Can I translate large YAML localization files?

This page works well for individual YAML files up to a few hundred kilobytes. For bulk YAML translation or very large files, use the I18N File Translation page which supports file uploads up to 5 MB and provides more reliable delivery for large-scale localization projects.