Fix for translated() in POEntry

1 view
Skip to first unread message

wpbasti

unread,
Dec 19, 2007, 7:47:32 AM12/19/07
to python-polib
The "translated" method had issues with detection of translated plural
values. Here comes the improved version:

def translated(self):
"""Return True if the entry has been translated or False"""
if self.obsolete or 'fuzzy' in self.flags:
return False

if self.msgstr != '':
return True

if self.msgstr_plural:
for pos in self.msgstr_plural:
if self.msgstr_plural[pos] == '':
return False

return True

return False

David Jean Louis

unread,
Dec 19, 2007, 9:00:13 AM12/19/07
to python...@googlegroups.com

Thanks Sebastian, I've just commited your changes as well as the __cmp__
method and some changes on how polib handles encoding.

David.

Reply all
Reply to author
Forward
0 new messages