How to load yml files instead of xliff for translating symfony application

I am trying to make a multilingual application with Symfony2 and I am currently trying to use yml files for translation instead of xliff (I think this is the default).

Based on Symfony documentation php, yml and xliff documents are accepted.

What I cannot find is where I have to set the translation file to be yml.

When I delete messages.fr.xliff

and do messages.fr.yml

, I get an exception:

[WARNING 1549] failed to load external entity "/home/ggirtsou/www/app.dev/src/ggirtsou/MyBundle/Resources/translations/messages.fr.xliff" (in n/a - line 0, column 0) 

      

I used $this->get('session')->setLocale('fr');

to set the locale to French.

+3


source to share


1 answer


You need to clear your cache whenever you add or move translation files. You don't have to do this by just editing them.



+3


source







All Articles