Configure Translation component in Symfony 2 to use gettext

落爺英雄遲暮 提交于 2019-12-11 05:19:17

问题


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

I have following configuration (app/config/config.yml):

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

How can I configure to support for mo files?


回答1:


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



来源:https://stackoverflow.com/questions/13218175/configure-translation-component-in-symfony-2-to-use-gettext

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!