Symfony2 Database Translation Loader isn't executed

后端 未结 2 1585
灰色年华
灰色年华 2021-01-14 09:43

I have to implement my own translation loader. I\'ve used the tutorial on: http://blog.elendev.com/development/php/symfony/use-a-database-as-translation-provider-in-symfony-

2条回答
  •  滥情空心
    2021-01-14 10:05

    Aldo answered this already but just to make it an official answer and to help others:

    You need to create a "fake" translation file to trigger your loader

    From Symfony Dependency Injection Tags: "translation.loader"

    [...] If you're loading translations from a database, you'll still need a resource file, but it might either be blank or contain a little bit of information about loading those resources from the database. The file is key to trigger the load method on your custom loader.

    So you need to crate files of the form .. in your translations folder app/Resources/translations/.

    In your case one file would be app/Resources/translations/messages.en.db for English.

提交回复
热议问题