Mercurial > babel > old > mirror
comparison babel/messages/mofile.py @ 175:c223445fdb82
Forgot to fix the pluralizable messages, regarding #28.
author | palgarvio |
---|---|
date | Tue, 26 Jun 2007 08:41:29 +0000 |
parents | aed3b2b06d19 |
children | b29bb8629a68 |
comparison
equal
deleted
inserted
replaced
174:aed3b2b06d19 | 175:c223445fdb82 |
---|---|
70 # terminated; the NUL does not count into the size. | 70 # terminated; the NUL does not count into the size. |
71 if message.pluralizable: | 71 if message.pluralizable: |
72 msgid = '\x00'.join([ | 72 msgid = '\x00'.join([ |
73 msgid.encode(catalog.charset) for msgid in message.id | 73 msgid.encode(catalog.charset) for msgid in message.id |
74 ]) | 74 ]) |
75 msgstrs = [] | |
76 for idx, string in enumerate(message.string): | |
77 if not string: | |
78 msgstrs.append(message.id[idx]) | |
79 else: | |
80 msgstrs.append(string) | |
75 msgstr = '\x00'.join([ | 81 msgstr = '\x00'.join([ |
76 msgstr.encode(catalog.charset) for msgstr in message.string | 82 msgstr.encode(catalog.charset) for msgstr in msgstrs |
77 ]) | 83 ]) |
78 else: | 84 else: |
79 msgid = message.id.encode(catalog.charset) | 85 msgid = message.id.encode(catalog.charset) |
80 if not message.string: | 86 if not message.string: |
81 msgstr = message.id.encode(catalog.charset) | 87 msgstr = message.id.encode(catalog.charset) |