i18n.py
changeset 7896 4c954e1e73ef
parent 7155 4bab50b02927
child 8225 baf8c16cae95
equal deleted inserted replaced
7894:ad0eeb0f7a8d 7896:4c954e1e73ef
    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"""