how can I configure YII i18n feature to use gettext?

若如初见. 提交于 2019-12-07 13:45:01

问题


I installed the yii-web-start extension, it uses a database for message translation, but I need use gettext instead.

Where and how can I configure YII-i18n?


回答1:


You can set up i18n in your config (protected/config/main.php) with CGettextMessageSource to use gettext.

'components' => array(
    'messages' => array(
        'class' => 'CGettextMessageSource'
     )
 ),

By default, you should store your .po-files under protected/messages.



来源:https://stackoverflow.com/questions/6735670/how-can-i-configure-yii-i18n-feature-to-use-gettext

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