common/i18n.py
branch3.5
changeset 3275 5247789df541
parent 3202 241ae91e9ab7
child 3293 69c0ba095536
child 3316 c4c07aab1c39
--- a/common/i18n.py	Wed Sep 16 21:23:35 2009 +0200
+++ b/common/i18n.py	Wed Sep 16 21:29:17 2009 +0200
@@ -25,10 +25,14 @@
     output.close()
 
 
-def add_msg(w, msgid):
+def add_msg(w, msgid, msgctx=None):
     """write an empty pot msgid definition"""
     if isinstance(msgid, unicode):
         msgid = msgid.encode('utf-8')
+    if msgctx:
+        if isinstance(msgctx, unicode):
+            msgctx = msgctx.encode('utf-8')
+        w('msgctxt "%s"\n' % msgctx)
     msgid = msgid.replace('"', r'\"').splitlines()
     if len(msgid) > 1:
         w('msgid ""\n')