我正在使用php-gettext library。按照教程here,我已经设置了_gettext()函数
require_once("locale/gettext.php");
require_once("locale/streams.php");
$locale_file = new FileReader("locale/$locale/LC_MESSAGES/messages.mo");
$locale_fetch = new gettext_reader($locale_file);
function _gettext($text){
global $locale_fetch;
return $locale_fetch->translate($text);
}我还想使用ngettext()函数来翻译多个文本。现在它不起作用了。我该怎么做呢?谢谢!
发布于 2014-06-09 12:40:04
好的,我找到了
function _ngettext($t1, $t2, $count){
global $locale_fetch;
return $locale_fetch->ngettext($t1, $t2, $count);
}https://stackoverflow.com/questions/24113672
复制相似问题