i18n/mki18n.py
changeset 1715 f50486ecdc21
parent 1703 ba0dde7f047a
child 1730 64d8f52bc8c8
equal deleted inserted replaced
1714:64ea7c86a74c 1715:f50486ecdc21
   184     #   --output=                   : specifies the name of the output file (using a .pot extension)
   184     #   --output=                   : specifies the name of the output file (using a .pot extension)
   185     cmd = 'xgettext -s --no-wrap --language=Python --files-from=' + filelist + ' --output=' + fileout + ' --package-name ' + applicationName
   185     cmd = 'xgettext -s --no-wrap --language=Python --files-from=' + filelist + ' --output=' + fileout + ' --package-name ' + applicationName
   186     if verbose: print cmd
   186     if verbose: print cmd
   187     os.system(cmd)
   187     os.system(cmd)
   188 
   188 
   189     cmd = 'sed --in-place ' + fileout + ' --expression=s/CHARSET/UTF-8/'
       
   190     if verbose: print cmd
       
   191     os.system(cmd)
       
   192 
       
   193     XSD_STRING_MODEL = re.compile("<xsd\:(?:element|attribute) name=\"([^\"]*)\"[^\>]*\>")
   189     XSD_STRING_MODEL = re.compile("<xsd\:(?:element|attribute) name=\"([^\"]*)\"[^\>]*\>")
   194     processCustomFiles(filelist, fileout, XSD_STRING_MODEL, 'Extra XSD strings')
   190     processCustomFiles(filelist, fileout, XSD_STRING_MODEL, 'Extra XSD strings')
   195 
   191 
   196     XML_TC6_STRING_MODEL = re.compile("<documentation>\s*<xhtml\:p><!\[CDATA\[([^\]]*)\]\]></xhtml\:p>\s*</documentation>", re.MULTILINE | re.DOTALL)
   192     XML_TC6_STRING_MODEL = re.compile("<documentation>\s*<xhtml\:p><!\[CDATA\[([^\]]*)\]\]></xhtml\:p>\s*</documentation>", re.MULTILINE | re.DOTALL)
   197     processCustomFiles(filelist, fileout, XML_TC6_STRING_MODEL, 'Extra TC6 documentation strings')    
   193     processCustomFiles(filelist, fileout, XML_TC6_STRING_MODEL, 'Extra TC6 documentation strings')    
       
   194 
       
   195     # generate messages.po
       
   196     cmd = 'msginit --no-wrap --no-translator -i %s -l en_US.UTF-8 -o messages.po' % (fileout)
       
   197     if verbose: print cmd
       
   198     os.system(cmd)    
   198 
   199 
   199     languageDict = getlanguageDict()
   200     languageDict = getlanguageDict()
   200 
   201 
   201     for langCode in languageDict.keys():
   202     for langCode in languageDict.keys():
   202         if langCode == 'en':
   203         if langCode == 'en':