]> git.wh0rd.org - tt-rss.git/blobdiff - lib/gettext/gettext.php
fix broken header of ru_RU translation thanks to Tomáš Chvátal; rebase translations
[tt-rss.git] / lib / gettext / gettext.php
index a121f9c7e7f5c24711b2f2cc7f71082f5f2a51c5..5064047cbd2427248c2a058e8ac09640bcb6c503 100755 (executable)
@@ -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;
+    }
+
   }
 }