示例#1
0
文件: ts.py 项目: flyeven/translate
 def getcontextname(self, contextnode):
     """returns the name of the given context"""
     namenode = ourdom.getFirstElementByTagName(contextnode, "name")
     return ourdom.getnodetext(namenode)
示例#2
0
文件: ts.py 项目: flyeven/translate
 def getmessagetype(self, message):
     """returns the message translation attributes for a given node"""
     translationnode = ourdom.getFirstElementByTagName(message, "translation")
     return translationnode.getAttribute("type")
示例#3
0
文件: ts.py 项目: flyeven/translate
 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)
示例#4
0
文件: ts.py 项目: flyeven/translate
 def getmessagesource(self, message):
     """returns the message source for a given node"""
     sourcenode = ourdom.getFirstElementByTagName(message, "source")
     return ourdom.getnodetext(sourcenode)
示例#5
0
文件: ts.py 项目: flyeven/translate
 def getmessagetranslation(self, message):
     """returns the message translation for a given node"""
     translationnode = ourdom.getFirstElementByTagName(message, "translation")
     return ourdom.getnodetext(translationnode)
示例#6
0
 def getcontextname(self, contextnode):
     """returns the name of the given context"""
     namenode = ourdom.getFirstElementByTagName(contextnode, "name")
     return ourdom.getnodetext(namenode)
示例#7
0
 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)
示例#8
0
 def getmessagetype(self, message):
     """returns the message translation attributes for a given node"""
     translationnode = ourdom.getFirstElementByTagName(
         message, "translation")
     return translationnode.getAttribute("type")
示例#9
0
 def getmessagetranslation(self, message):
     """returns the message translation for a given node"""
     translationnode = ourdom.getFirstElementByTagName(
         message, "translation")
     return ourdom.getnodetext(translationnode)
示例#10
0
 def getmessagesource(self, message):
     """returns the message source for a given node"""
     sourcenode = ourdom.getFirstElementByTagName(message, "source")
     return ourdom.getnodetext(sourcenode)