@@ -124,3 +124,25 @@ of the default ``ArrayLoader``::
...
@@ -124,3 +124,25 @@ of the default ``ArrayLoader``::
$app['translator.loader'] = new Symfony\Component\Translation\Loader\YamlFileLoader();
$app['translator.loader'] = new Symfony\Component\Translation\Loader\YamlFileLoader();
And that's all you need to load translations from YAML files.
And that's all you need to load translations from YAML files.
XLIFF-based language files
~~~~~~~~~~~~~~~~~~~~~~~~~
Just as you would do with YAML translation files, you first need to make sure you have the ``Config`` component from Symfony2, and that they are registered with the autoloader. See above for details.
Then, similarly, create XLIFF files in your locales directory and setup the ``translator.messages`` to map to them.
Finally override the ``translator.loader`` to use a ``XliffFileLoader``::
$app['translator.loader'] = new Symfony\Component\Translation\Loader\XliffFileLoader();
That's it.
Adding translations in Twig templates
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The translation service provider is available from within Twig templates: