summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/bzlib/huffman.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdk-stage1/bzlib/huffman.c')
0 files changed, 0 insertions, 0 deletions
%os.path.basename(sys.argv[0]) print ' generate pot catalogs and updates po files for xsl resources in the specified directory' print 'Options: -h, --help : usage' print ' -d <directory>, --directory <directory> : directory with xsl files' sys.exit(2) try: opts, args = getopt.getopt(sys.argv[1:], "hd:", ["help", "directory="]) except getopt.GetoptError: usage() # print help information and exit directory='.' for o,a in opts: if o in ("-h", "--help"): usage() if o in ("-d", "--directory"): directory=a directory = directory.rstrip('/') if (directory != '') and (os.path.isdir(directory) == False): sys.exit('Specified directory does not exist') # Find all XSL files files = [] for rootdir, dirnames, filenames in os.walk(directory): files.extend(glob.glob(rootdir + "/*.xsl")) # Define Templates and po directory name translationtemplate='l:l10n\ (.*?)<\/l:l10n' tpattern=re.compile(translationtemplate,re.DOTALL) entemplate='language=\"en\">\n(.*?)<\/l:l10n' enpattern=re.compile(entemplate,re.DOTALL) langtemplate='language=\"(.*?)\"' lpattern=re.compile(langtemplate,re.DOTALL) messagetemplate='<l:gentext key=\"(.*?)\"\/>' mpattern=re.compile(messagetemplate,re.DOTALL) transblocktemplate='<l:i18n xmlns:l="http:\/\/docbook.sourceforge.net\/xmlns\/l10n\/1.0\">(.*?)<\/l:i18n>' tbpattern=re.compile(transblocktemplate,re.DOTALL) blocktemplate='<l:i18n xmlns:l=\"http://docbook.sourceforge.net/xmlns/l10n/1.0\">\n</l:i18n>' podir = 'po' # Write POT file pot = polib.POFile('',check_for_duplicates=True) potcreationtime = strftime('%Y-%m-%d %H:%M%z') pot.metadata = { 'Project-Id-Version': 'Mageia XSL files translation', 'Report-Msgid-Bugs-To': 'i18n-discuss@ml.mageia.org', 'POT-Creation-Date': potcreationtime, 'PO-Revision-Date': 'YEAR-MO-DA HO:MI+ZONE', 'Last-Translator': 'FULL NAME <EMAIL@ADDRESS>', 'Language-Team': 'LANGUAGE <LL@li.org>', 'MIME-Version': '1.0', 'Content-Type': 'text/plain; charset=UTF-8', 'Content-Transfer-Encoding': '8bit', } for langfile in files: langfiledir = langfile.replace('.xsl', '') langfilename = langfiledir.rpartition('/')[2] # Create localization directories if needed try: os.makedirs(podir)