Symfony Translation Tutorial: Messages, PO Files & Best Practices

Complete 2026 guide to translating a Symfony 7 app. Covers message catalogs, domains and the domain.locale.format naming rule, translating in PHP with trans() and TranslatableMessage, the Twig trans filter and {% trans %} tag, XLIFF vs YAML vs PO, using gettext PO files natively (including what the PO loader does and does not support), pipe-syntax vs ICU MessageFormat plurals, _locale routing and LocaleSwitcher, translation:extract and debug:translation, form and validator messages, translation providers, cache pitfalls, and a best-practices checklist.

Back to the PO-File blog