Package translate :: Package storage :: Module ts :: Class QtTsParser |
[hide private]
[frames] | no frames]

# Class QtTsParser

source code

Instance Methods | [hide private]
__init__(self, inputfile=None) make a new QtTsParser, reading from the given inputfile if required | source code
addtranslation(self, contextname, source, translation, comment=None, transtype=None, createifmissing=False) adds the given translation (will create the nodes required if asked). | source code
getxml(self) return the ts file as xml | source code
getcontextname(self, contextnode) returns the name of the given context | source code
getcontextnode(self, contextname) finds the contextnode with the given name | source code
getmessagenodes(self, context=None) returns all the messagenodes, limiting to the given context (name or node) if given | source code
getmessagesource(self, message) returns the message source for a given node | source code
getmessagetranslation(self, message) returns the message translation for a given node | source code
getmessagetype(self, message) returns the message translation attributes for a given node | source code
getmessagecomment(self, message) returns the message comment for a given node | source code
iteritems(self) iterates through (contextname, messages) | source code
__del__(self) clean up the document if required | source code

Class Variables | [hide private]
| contextancestors = ``{``'``TS``'``:` None`}``
| messageancestors = ``{``'``TS``'``:` None`,` `'``context``'``:` None`}``

Method Details | [hide private]

### addtranslation(self, contextname, source, translation, comment=None, transtype=None, createifmissing=False) | source code
adds the given translation (will create the nodes required if asked). Returns success