dbapi.py
branch3.5
changeset 3275 5247789df541
parent 3258 6536ee4f37f7
child 3293 69c0ba095536
child 3707 78596919ede3
--- a/dbapi.py	Wed Sep 16 21:23:35 2009 +0200
+++ b/dbapi.py	Wed Sep 16 21:29:17 2009 +0200
@@ -214,10 +214,13 @@
             self.lang = 'en'
         # use req.__ to translate a message without registering it to the catalog
         try:
-            self._ = self.__ = self.translations[self.lang]
+            gettext, pgettext = self.translations[self.lang]
+            self._ = self.__ = gettext
+            self.pgettext = pgettext
         except KeyError:
             # this occurs usually during test execution
             self._ = self.__ = unicode
+            self.pgettext = lambda x,y: y
         self.debug('request default language: %s', self.lang)
 
     def decorate_rset(self, rset):