Example #1
0
 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")
Example #2
0
 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")
Example #3
0
def test_stripcomment():
    assert quote.stripcomment("<!-- Comment -->") == "Comment"
Example #4
0
def test_stripcomment():
    assert quote.stripcomment("<!-- Comment -->") == "Comment"