def getcontextname(self, contextnode): """returns the name of the given context""" namenode = ourdom.getFirstElementByTagName(contextnode, "name") return ourdom.getnodetext(namenode)
def getmessagetranslation(self, message): """returns the message translation for a given node""" translationnode = ourdom.getFirstElementByTagName(message, "translation") return ourdom.getnodetext(translationnode)
def getmessagecomment(self, message): """returns the message comment for a given node""" commentnode = ourdom.getFirstElementByTagName(message, "comment") # NOTE: handles only one comment per msgid (OK) # and only one-line comments (can be VERY wrong) TODO!!! return ourdom.getnodetext(commentnode)
def getmessagesource(self, message): """returns the message source for a given node""" sourcenode = ourdom.getFirstElementByTagName(message, "source") return ourdom.getnodetext(sourcenode)
def getmessagetranslation(self, message): """returns the message translation for a given node""" translationnode = ourdom.getFirstElementByTagName( message, "translation") return ourdom.getnodetext(translationnode)