根据当前的Translation Documentation,Symfony2在以下位置查找消息文件(即翻译):
the <kernel root directory>/Resources/translations directory;
the <kernel root directory>/Resources/<bundle name>/translations directory;
the Resources/translations/ directory of the bundle.有没有办法迫使Symfony2调查
the <kernel root directory>/Resources/translations/mydirectory directory;发布于 2013-05-29 19:07:51
您必须编写自己的转换加载器Symfony\Component\Translation\Loader\LoaderInterface并使用translation.loader标记它。
您的翻译器必须实现loadMessages($directory, MessageCatalogue $catalogue)方法。
您可以将其实现为$this->symfonyLoader->loadMessages($directory."/subdir", $catalogue);
可以使用DI容器传递$this->symfonyLoader
https://stackoverflow.com/questions/13290903
复制相似问题