common/i18n.py
changeset 3293 69c0ba095536
parent 3230 1d25e928c299
parent 3275 5247789df541
child 3369 7b88d12b4ee2
--- a/common/i18n.py	Tue Sep 15 15:01:41 2009 +0200
+++ b/common/i18n.py	Thu Sep 17 15:16:53 2009 +0200
@@ -26,10 +26,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')