Ruby yaml format
Ruby on Rails uses YAML as its default localization format with a specific file structure convention. Each locale file is named after the locale code — en.yml, fr.yml, de.yml — and the top-level key in the file is the locale code itself wrapping the entire key tree. Rails' I18n module resolves the correct file automatically based on the current locale.
Rails YAML files start with the locale code as the root key, followed by nested key hierarchies that mirror the application structure. Models, controllers, and views each typically have their own section. Interpolation uses percent-wrapped variable names. Pluralisation uses one and other keys by default, with zero, few, many added for languages that require them. ActiveRecord model names and attribute labels for error messages follow a specific convention under the activerecord key.
Best practice: mirror the Rails namespace conventions — use the controller.action.key pattern for view strings and the activerecord.models.name pattern for model-related content. Run the i18n-tasks gem in CI to detect missing translations, unused keys, and inconsistencies between locale files. Use lazy lookup in views — i18n calls can resolve the locale key based on the view file path automatically. Language Monster supports Ruby YAML format and preserves the Rails locale key hierarchy through translation.
