hvertous
hvertous

Reputation: 1173

symfony translation resource path

I can't make my translator to load a resource yams file. I have a file admin.ru.yml inside AppBundle/Resources/config/translations/ I have in my other bundle the following lines

    $translator = new Translator('ru_RU', new MessageSelector());
    $translator->addLoader('yaml', new FileLoader());
    $translator->addResource('yaml', 'admin.ru.yml', 'ru_RU', 'admin');
    $tt = $translator->trans('Category', array(), 'admin');

It does not load the yml file.

I even have specified in my app/config.yml file of the whole application

   translator:
       paths:
        - '%kernel.root_dir%/../src/AppBundle/Resources/config/translations'

but with no result. I tried many paths but can't find the right way. Any suggestions of what am I doing wrong?

Upvotes: 0

Views: 483

Answers (1)

mduvernon
mduvernon

Reputation: 498

you have to rename your file @AppBundle.ru.yml, the file path is not necessary

Upvotes: 1

Related Questions