From add9bc3a38faa0abc30ac1d51d8fa1bdf40883cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 1 Apr 2010 09:53:54 +0200 Subject: [PATCH] Fix pgettext when there is no translation. --- libraries/php-gettext/gettext.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/php-gettext/gettext.php b/libraries/php-gettext/gettext.php index a121f9c7e..80d249709 100644 --- a/libraries/php-gettext/gettext.php +++ b/libraries/php-gettext/gettext.php @@ -409,7 +409,12 @@ 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) {