Class POEntry
source code
_BaseEntry --+
|
POEntry
Represents a po file entry.
Examples:
>>> entry = POEntry(msgid='Welcome', msgstr='Bienvenue')
>>> entry.occurences = [('welcome.py', 12), ('anotherfile.py', 34)]
>>> print entry
#: welcome.py:12 anotherfile.py:34
msgid "Welcome"
msgstr "Bienvenue"
<BLANKLINE>
>>> entry = POEntry()
>>> entry.occurences = [('src/spam.c', 32), ('src/eggs.c', 45)]
>>> entry.tcomment = 'A plural translation'
>>> entry.flags.append('c-format')
>>> entry.msgid = 'I have spam but no egg !'
>>> entry.msgid_plural = 'I have spam and %d eggs !'
>>> entry.msgstr_plural[0] = "J'ai du jambon mais aucun oeuf !"
>>> entry.msgstr_plural[1] = "J'ai du jambon et %d oeufs !"
>>> print entry
# A plural translation
#: src/spam.c:32 src/eggs.c:45
#, c-format
msgid "I have spam but no egg !"
msgid_plural "I have spam and %d eggs !"
msgstr[0] "J'ai du jambon mais aucun oeuf !"
msgstr[1] "J'ai du jambon et %d oeufs !"
<BLANKLINE>
__str__(self,
wrapwidth=78)
(Informal representation operator)
| source code
|
Return the string representation of the entry.
- Overrides:
_BaseEntry.__str__
|