Base class for translation units.
As such most of the method- and variable names borrows from XLIFF
terminology.
|
|
__init__(self,
source=None,
encoding='UTF-8')
Constructs a TranslationUnit containing the given source string. |
source code
|
|
|
|
_initallcomments(self,
blankall=False)
Initialises allcomments |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
merge(self,
otherpo,
overwrite=False,
comments=True,
authoritative=False)
Merges the otherpo (with the same msgid) into this one. |
source code
|
|
|
|
|
|
|
|
|
|
hastypecomment(self,
typecomment)
check whether the given type comment is present |
source code
|
|
|
|
hasmarkedcomment(self,
commentmarker)
check whether the given comment marker is present as #
(commentmarker) ... |
source code
|
|
|
|
settypecomment(self,
typecomment,
present=True)
alters whether a given typecomment is present |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
makeobsolete(self)
Makes this unit obsolete |
source code
|
|
|
|
resurrect(self)
Makes an obsolete unit normal |
source code
|
|
|
|
|
|
|
|
|
|
_getmsgpartstr(self,
partname,
partlines,
partcomments='') |
source code
|
|
|
|
_encodeifneccessary(self,
output)
encodes unicode strings and returns other strings unchanged |
source code
|
|
|
|
|
|
|
_getoutput(self)
return this po element as a string |
source code
|
|
|
String
|
|
|
|
|
|
string
|
|
|
Inherited from pocommon.pounit:
markreviewneeded
Inherited from base.TranslationUnit:
__eq__,
getunits,
unit_iter
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__
|
|
|
getsource(self)
Returns the unescaped msgid |
source code
|
|
|
|
|
|
|
gettarget(self)
Returns the unescaped msgstr |
source code
|
|
|
|
|
|
Inherited from base.TranslationUnit:
gettargetlen
|
|
|
getnotes(self,
origin=None)
Return comments based on origin value (programmer, developer, source
code and translator) |
source code
|
|
|
|
addnote(self,
text,
origin=None,
position='append')
This is modeled on the XLIFF method. |
source code
|
|
|
|
|
|
List
|
|
|
|
|
|
Inherited from base.TranslationUnit:
addlocations
|
|
Inherited from pocommon.pounit:
adderror,
geterrors
|