0

I am using the php-gettext library. Following the tutorial here, I have set up the _gettext() function

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

I also want to use the ngettext() function to translate plural texts. Now it does not work. How can I do that? Thanks!

user2335065
  • 2,337
  • 3
  • 31
  • 54

1 Answers1

0

ok I found it

function _ngettext($t1, $t2, $count){
    global $locale_fetch;
    return $locale_fetch->ngettext($t1, $t2, $count);
}
user2335065
  • 2,337
  • 3
  • 31
  • 54