Symfony
Symfony applications can be localized using YAML resource files. While YAML is a standardized format, the Symfony parser implements a specific subset of the standard. We recommend following the official Symfony documentation for the best results.
For information on handling Ruby on Rails YAML files, please refer to our Ruby on Rails localization guide.
Format
- Symfony uses a flat YAML structure; hierarchical structures are not supported by the Symfony parser.
- Keys can be based on source language text or generic identifiers. LingoHub recommends using generic keys.
- Key-value pairs are delimited by a colon
:. - Values can be enclosed in single or double quotes.
- Comments beginning with a hash sign
#are parsed and assigned as descriptions if they directly precede a key-value pair. - The default placeholder syntax is
%{placeholder}. - YAML array syntax is not supported by the Symfony parser.
- LingoHub produces syntactically correct YAML files upon export, although the specific quoting or escaping may differ from the imported file.
LingoHints can be included in a comment:
# <lh>{"status": "DRAFT","qc": {"min": "3","max": "20"},"labels": ["q3-2024"],"not_translatable": false}</lh>
header.hello_user: Hello %{username}Example
Additional example files are available on GitHub.
# Generic key example
author.name.not_blank: Please enter an author name.
# Placeholder example
users.salutation: "Hello %{username}"
# Source text used as key
"Symfony is great": "J'aime Symfony"References
Updated about 1 month ago
