2011-01-19 16 views

回答

1

不,没有。低级的libgettext API也不提供任何方法。

但是,您可以使用(并重写)来自Zend_Translate(或php-gettext或gettext.php)的gettext适配器来读取整个gettext消息文件。

+0

基本上,要做到这一点,你需要为.mo文件编写解析器? – umpirsky 2011-01-19 15:47:55

0

当前域根据定义包含无限的消息,所以你的问题是没有那么有用。 “如何枚举特定消息目录中的消息?”可能更适合。

Get translations from .po or .mo file

这是可能的命令行,例如上

$ msgcat <catalog-name> 
... 
#: conf/global_settings.py:44 
msgid "Arabic" 
msgstr "Árabe" 

#: conf/global_settings.py:45 
msgid "Bengali" 
msgstr "Bengalês"