summaryrefslogtreecommitdiff
path: root/lib/gettext/gettext.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gettext/gettext.php')
-rwxr-xr-xlib/gettext/gettext.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/gettext/gettext.php b/lib/gettext/gettext.php
index a121f9c7e..5064047cb 100755
--- a/lib/gettext/gettext.php
+++ b/lib/gettext/gettext.php
@@ -409,12 +409,23 @@ class gettext_reader {
function pgettext($context, $msgid) {
$key = $context . chr(4) . $msgid;
- return $this->translate($key);
+ $ret = $this->translate($key);
+ if (strpos($ret, "\004") !== FALSE) {
+ return $msgid;
+ } else {
+ return $ret;
+ }
}
function npgettext($context, $singular, $plural, $number) {
- $singular = $context . chr(4) . $singular;
- return $this->ngettext($singular, $plural, $number);
+ $key = $context . chr(4) . $singular;
+ $ret = $this->ngettext($key, $plural, $number);
+ if (strpos($ret, "\004") !== FALSE) {
+ return $singular;
+ } else {
+ return $ret;
+ }
+
}
}