From ab22cafc646f9fca88711ef4b467a006c4f9f7d0 Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Mon, 19 Jan 2009 16:36:26 -0500 Subject: Remove obsolete translation tools. Signed-off-by: Loui Chang --- web/utils/genpopo | 170 ------------------------------------------------------ 1 file changed, 170 deletions(-) delete mode 100755 web/utils/genpopo (limited to 'web/utils/genpopo') diff --git a/web/utils/genpopo b/web/utils/genpopo deleted file mode 100755 index 66bf9a12..00000000 --- a/web/utils/genpopo +++ /dev/null @@ -1,170 +0,0 @@ -#! /usr/bin/python -O -# -*- coding: iso-8859-1 -*- - -# This script iterates through the script directories -# looking for php scripts that contain __() functions. -# It creates/appends to the corresponding -# "xxx.po" file in the 'lang' subdirectory and places the -# i18n strings into the file in the proper format. -# -# usage: genpopo [-v] [-f] -# -v: verbose, print duplicate terms that could be moved to common_po -# -f: force, overwrite existing translated files, otherwise append -# - -import re -import os -import sys - -INC_HEADER = """\ -", "?>\n", "\n?>"]: - del contents[-1] - - f = open(pofile,'w') - f.write("".join(contents)) - f.write("\n"); - f.close() - else: - f = open(pofile,'w') - f.write(INC_HEADER) - f.write('\n') - f.close() - - # Read file contents so we can hash what already exists - try: - f = open(pofile, 'r') - new_file = 0 - except: - new_file = 1 - - existing_terms = [] - if not new_file: - contents = f.readlines() - f.close() - - # Strip beginning/ending empty lines - while contents[0] == '': - del contents[0] - while contents[-1] in ['', "\n", "?>", "?>\n", "\n?>"]: - del contents[-1] - - # Collect existing terms - for line in contents: - match = mapre.search(line) - if match: - existing_terms.append(match.group(1)) - - # Append any new terms to EOF - f = open(pofile, 'w') - if not new_file: - f.write("".join(contents)) - else: - f.write(INC_HEADER) - - for term in lang.keys(): - if term not in existing_terms: - f.write("\n"); - f.write('$_t["%s"]\n = "%s";\n' % (term, term)) - f.write("\n"); - f.close() - -- cgit v1.2.3-24-g4f1b