Implement gettext wit context.
This commit is contained in:
@@ -259,6 +259,17 @@ function _gettext($msgid) {
|
|||||||
function __($msgid) {
|
function __($msgid) {
|
||||||
return _gettext($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.
|
* Plural version of gettext.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user