Blob Blame History Raw
From ef78e23ed8eaec1143828be05b0688c2830359be Mon Sep 17 00:00:00 2001
From: Rafal Luzynski <digitalfreak@lingonborough.com>
Date: Sat, 5 Mar 2016 22:32:54 +0100
Subject: [PATCH] Implement pgettext and its alias C_

See the link below for more details:
https://bugs.python.org/issue2504

    Jakub Filak <jfilak@redhat.com>
---
 src/gnome_abrt/l10n.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/gnome_abrt/l10n.py b/src/gnome_abrt/l10n.py
index 59ade97..55e7195 100644
--- a/src/gnome_abrt/l10n.py
+++ b/src/gnome_abrt/l10n.py
@@ -46,3 +46,12 @@ def init(progname, localedir='/usr/share/locale'):
                                     locale.nl_langinfo(locale.CODESET))
     gettext.bindtextdomain(progname, localedir)
     gettext.textdomain(progname)
+
+def pgettext(context, message):
+    result = gettext.gettext(context + "\004" + message)
+    if "\004" in result:
+        return message
+    else:
+        return result
+
+C_ = pgettext
-- 
2.4.11