Zend GetText和.mo .po文件 [英] Zend GetText and .mo .po files

查看:82
本文介绍了Zend GetText和.mo .po文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从一家开发公司的应用程序继承而来,我需要获取为我的网站生成的.mo和.po文件.

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);

我必须在网站上设置文本的所有地方都使用翻译帮助器,但是.mo和.po文件未包含在应用程序中设置的所有字符串.

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.

是否需要运行一些命令来填充gettext文件?

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

谢谢!

推荐答案

您可以使用 Poedit ,然后配置它以扫描您的源(* .php和* .phtml),这些源将生成.po和.mo文件.由于我猜您已经在使用Poedit来输入翻译-因此,您也可以利用它的功能来扫描源文件并从代码中收集所有翻译字符串.

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.

此处是一个很好的教程,介绍如何配置Poedit,以便它可以从模板中识别Zend Framework文件和$this->translate('')命令.

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

祝你好运.

这篇关于Zend GetText和.mo .po文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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