i18n.py
branchstable
changeset 8124 acc23c284432
parent 7896 4c954e1e73ef
child 8225 baf8c16cae95
equal deleted inserted replaced
8118:7b2c7f3d3703 8124:acc23c284432
    31     using standard python gettext marker (_)
    31     using standard python gettext marker (_)
    32     """
    32     """
    33     output = open(output_file, 'w')
    33     output = open(output_file, 'w')
    34     for filepath in files:
    34     for filepath in files:
    35         for match in re.finditer('i18n:(content|replace)="([^"]+)"', open(filepath).read()):
    35         for match in re.finditer('i18n:(content|replace)="([^"]+)"', open(filepath).read()):
    36             print >> output, '_("%s")' % match.group(2)
    36             output.write('_("%s")' % match.group(2))
    37     output.close()
    37     output.close()
    38 
    38 
    39 
    39 
    40 def add_msg(w, msgid, msgctx=None):
    40 def add_msg(w, msgid, msgctx=None):
    41     """write an empty pot msgid definition"""
    41     """write an empty pot msgid definition"""