Zend GetText and .mo .po files

那年仲夏 提交于 2019-12-07 10:08:29

问题


I have inherited from an application made a developement company, and i need to get the .mo and .po files generated for my website.

Here's what i have in the bootstrap :

$translate = new Zend_Translate ('gettext', ROOT_PATH.'/languages/en/default.mo', 'en', array('disableNotices' => true));
$translate->setLocale($locale);

I'm using the translate helper everywhere i have to set up text on my website but my .mo and .po files do not contain all the strings that are set up in my application.

Is there some command that i need to run for the gettext files to be populated?

Thanks !


回答1:


You can use Poedit, and configure it to scan your sources (*.php and *.phtml), which generates .po and .mo files. Since I guess you're already using Poedit to enter translations - so you can as well use its ability to scan source files and collect all the translation strings from your code.

Here is a good tutorial how to configure Poedit so it will recognize Zend Framework files and $this->translate('') commands from templates.

Good luck.



来源:https://stackoverflow.com/questions/9127197/zend-gettext-and-mo-po-files

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