配置Symfony 2中的Translation组件以使用gettext [英] Configure Translation component in Symfony 2 to use gettext

查看:50
本文介绍了配置Symfony 2中的Translation组件以使用gettext的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Symfony 2(2.1版)支持gettext(MO和PO文件).

Symfony 2 as version 2.1 supports gettext (MO and PO files).

我具有以下配置(app/config/config.yml):

framework:
    translator:      { fallback: "en" }
    default_locale:  "fa_ir"
    ...

如何配置为支持mo文件?

How can I configure to support for mo files?

推荐答案

我发现没有任何配置,我可以将messages.fa_ir.mo放在bundle的Resources/translations目录中,而Symfony2本身会找到它...

I found without any configuration I can put messages.fa_ir.mo in Resources/translations directory of bundle and Symfony2 itself will find it...

这篇关于配置Symfony 2中的Translation组件以使用gettext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆