server/session.py
branch3.5
changeset 3275 5247789df541
parent 3240 8604a15995d1
child 3293 69c0ba095536
child 3553 76b4a177a018
--- a/server/session.py	Wed Sep 16 21:23:35 2009 +0200
+++ b/server/session.py	Wed Sep 16 21:29:17 2009 +0200
@@ -210,13 +210,18 @@
         vreg = self.vreg
         language = language or self.user.property_value('ui.language')
         try:
-            self._ = self.__ = vreg.config.translations[language]
+            gettext, pgettext = vreg.config.translations[language]
+            self._ = self.__ = gettext
+            self.pgettext = pgettext
         except KeyError:
             language = vreg.property_value('ui.language')
             try:
-                self._ = self.__ = vreg.config.translations[language]
+                gettext, pgettext = vreg.config.translations[language]
+                self._ = self.__ = gettext
+                self.pgettext = pgettext
             except KeyError:
                 self._ = self.__ = unicode
+                self.pgettext = lambda x,y: y
         self.lang = language
 
     def change_property(self, prop, value):