A single unit in the file. Provisional work is done to make several
languages possible.
|
|
__init__(self,
source,
empty=False,
**kwargs)
Constructs a unit containing the given source string |
source code
|
|
|
Boolean
|
|
|
|
|
|
|
createlanguageNode(self,
lang,
text,
purpose=None)
Returns a xml Element setup with given parameters to represent a
single language entry. |
source code
|
|
|
|
createPHnodes(self,
parent,
text)
Create the text node in parent containing all the ph tags |
source code
|
|
|
|
getlanguageNodes(self)
Returns a list of all nodes that contain per language information. |
source code
|
|
|
|
getlanguageNode(self,
lang=None,
index=None)
Retrieves a languageNode either by language or by index |
source code
|
|
|
|
getNodeText(self,
languageNode,
xml_space='preserve')
Retrieves the term from the given languageNode |
source code
|
|
|
|
__str__(self)
Converts to a string representation that can be parsed back using
parsestring(). |
source code
|
|
|
|
|
|
Inherited from base.TranslationUnit:
get_state_id,
get_state_n,
getcontext,
getid,
getunits,
hasplural,
infer_state,
isblank,
isfuzzy,
isheader,
isobsolete,
isreview,
istranslatable,
istranslated,
makeobsolete,
markfuzzy,
markreviewneeded,
merge,
multistring_to_rich,
set_state_n,
setcontext,
setid,
unit_iter
Inherited from object:
__delattr__,
__format__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__setattr__,
__sizeof__,
__subclasshook__
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inherited from base.TranslationUnit:
getsourcelanguage
|
|
|
| set_target_dom(self,
dom_node,
append=False) |
source code
|
|
|
|
|
|
|
settarget(self,
text,
lang='xx',
append=False)
Sets the "target" string (second language), or
alternatively appends to the list |
source code
|
|
|
|
gettarget(self,
lang=None)
retrieves the "target" text (second entry), or the entry in
the specified language, if it exists |
source code
|
|
|
Inherited from base.TranslationUnit:
gettargetlanguage,
gettargetlen
|
|
Inherited from base.TranslationUnit:
addnote,
getnotes,
removenotes
|
|
Inherited from base.TranslationUnit:
addlocation,
addlocations,
getlocations
|
|
Inherited from base.TranslationUnit:
adderror,
geterrors
|