コード例 #1
0
ファイル: dtd2po.py プロジェクト: alghaamdi/translate
 def convertcomments(self, dtd_unit, po_unit):
     entity = dtd_unit.getid()
     if len(entity) > 0:
         po_unit.addlocation(entity)
     for commenttype, comment in dtd_unit.comments:
         # handle groups
         if (commenttype == "locgroupstart"):
             groupcomment = comment.replace('BEGIN', 'GROUP')
             self.currentgroup = groupcomment
         elif (commenttype == "locgroupend"):
             groupcomment = comment.replace('END', 'GROUP')
             self.currentgroup = None
         # handle automatic comment
         if commenttype == "automaticcomment":
             po_unit.addnote(comment, origin="developer")
         # handle normal comments
         else:
             po_unit.addnote(quote.stripcomment(comment), origin="developer")
     # handle group stuff
     if self.currentgroup is not None:
         po_unit.addnote(quote.stripcomment(self.currentgroup),
                       origin="translator")
     if is_css_entity(entity):
         po_unit.addnote("Do not translate this.  Only change the numeric values if you need this dialogue box to appear bigger",
                       origin="developer")
コード例 #2
0
ファイル: dtd2po.py プロジェクト: lambacck/translate
 def convertcomments(self, dtd_unit, po_unit):
     entity = dtd_unit.getid()
     if len(entity) > 0:
         po_unit.addlocation(entity)
     for commenttype, comment in dtd_unit.comments:
         # handle groups
         if (commenttype == "locgroupstart"):
             groupcomment = comment.replace('BEGIN', 'GROUP')
             self.currentgroup = groupcomment
         elif (commenttype == "locgroupend"):
             groupcomment = comment.replace('END', 'GROUP')
             self.currentgroup = None
         # handle automatic comment
         if commenttype == "automaticcomment":
             po_unit.addnote(comment, origin="developer")
         # handle normal comments
         else:
             po_unit.addnote(quote.stripcomment(comment),
                             origin="developer")
     # handle group stuff
     if self.currentgroup is not None:
         po_unit.addnote(quote.stripcomment(self.currentgroup),
                         origin="translator")
     if is_css_entity(entity):
         po_unit.addnote(
             "Do not translate this.  Only change the numeric values if you need this dialogue box to appear bigger",
             origin="developer")
コード例 #3
0
ファイル: test_quote.py プロジェクト: nijel/translate
def test_stripcomment():
    assert quote.stripcomment("<!-- Comment -->") == "Comment"
コード例 #4
0
ファイル: test_quote.py プロジェクト: onia/translate
def test_stripcomment():
    assert quote.stripcomment("<!-- Comment -->") == "Comment"