首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Symfony2翻译

Symfony2翻译
EN

Stack Overflow用户
提问于 2012-11-08 22:25:50
回答 1查看 302关注 0票数 0

根据当前的Translation Documentation,Symfony2在以下位置查找消息文件(即翻译):

代码语言:javascript
复制
the <kernel root directory>/Resources/translations directory;
the <kernel root directory>/Resources/<bundle name>/translations directory;
the Resources/translations/ directory of the bundle.

有没有办法迫使Symfony2调查

代码语言:javascript
复制
the <kernel root directory>/Resources/translations/mydirectory directory;
EN

回答 1

Stack Overflow用户

发布于 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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13290903

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档