changeset 173:743abd4ca3c3

Forgot to fix the pluralizable messages, regarding #28.
author palgarvio
date Tue, 26 Jun 2007 08:41:29 +0000
parents 9e35bbb458aa
children 456ee0941987
files babel/messages/mofile.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/babel/messages/mofile.py
+++ b/babel/messages/mofile.py
@@ -72,8 +72,14 @@
             msgid = '\x00'.join([
                 msgid.encode(catalog.charset) for msgid in message.id
             ])
+            msgstrs = []
+            for idx, string in enumerate(message.string):
+                if not string:
+                    msgstrs.append(message.id[idx])
+                else:
+                    msgstrs.append(string)
             msgstr = '\x00'.join([
-                msgstr.encode(catalog.charset) for msgstr in message.string
+                msgstr.encode(catalog.charset) for msgstr in msgstrs
             ])
         else:
             msgid = message.id.encode(catalog.charset)
Copyright (C) 2012-2017 Edgewall Software