Implement gettext wit context.

This commit is contained in:
Michal Čihař
2010-03-11 18:45:48 +01:00
parent 0fb8f2c7ef
commit 179e6e90a0

View File

@@ -259,6 +259,17 @@ function _gettext($msgid) {
function __($msgid) {
return _gettext($msgid);
}
/**
* Gettext with context.
*/
function _pgettext($msgctx, $msgid) {
$ret = _gettext($msgctx . "\004" . $msgid);
if (strpos($ret, "\004") !== FALSE) {
return $msgid;
} else {
return $ret;
}
}
/**
* Plural version of gettext.
*/