From 1e35dc01cf94ba1ec4923b8f040e49b4dc399860 Mon Sep 17 00:00:00 2001 From: eric Date: Fri, 18 Jun 2004 16:23:14 +0000 Subject: finishing touches on genpopo, started playing with _real_ PHP code and svn keywords --- web/utils/genpopo | 52 ++++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-) (limited to 'web/utils') diff --git a/web/utils/genpopo b/web/utils/genpopo index ea6569a2..64c71ede 100755 --- a/web/utils/genpopo +++ b/web/utils/genpopo @@ -12,6 +12,22 @@ # -f: force, overwrite existing translated files, otherwise append # +INC_HEADER = """\ + Spanish translation here. <--";\n' % term) - f.write('# $_t["fr"]["%s"] = "--> French translation here. <--";\n' % term) - f.write('# $_t["de"]["%s"] = "--> German translation here. <--";\n' % term) + f.write('# $_t["es"]["%s"] = "--> Traducción española aquí. <--";\n' % term) + f.write('# $_t["fr"]["%s"] = "--> Traduction française ici. <--";\n' % term) + f.write('# $_t["de"]["%s"] = "--> Deutsche Übersetzung hier. <--";\n' % term) f.write("\n"); f.write("?>"); @@ -153,21 +166,11 @@ else: contents = f.readlines() f.close() - # remove PHP tags - # - stripped_contents = [] - for line in contents: - if line.strip() not in [""]: - stripped_contents.append(line) - contents = stripped_contents - # strip off beginning/ending empty lines # while contents[0] == '': del contents[0] - while contents[-1] == '': - del contents[-1] - if contents[-1] == "\n": + while contents[-1] in ['', "\n", "?>", "?>\n", "\n?>"]: del contents[-1] # next, collect existing terms @@ -180,17 +183,18 @@ else: # now append any new terms to EOF # f = open(po, 'w') - f.write(" Spanish translation here. <--";\n' % term) - f.write('# $_t["fr"]["%s"] = "--> French translation here. <--";\n' % term) - f.write('# $_t["de"]["%s"] = "--> German translation here. <--";\n' % term) + f.write('# $_t["es"]["%s"] = "--> Traducción española aquí. <--";\n' % term) + f.write('# $_t["fr"]["%s"] = "--> Traduction française ici. <--";\n' % term) + f.write('# $_t["de"]["%s"] = "--> Deutsche Übersetzung hier. <--";\n' % term) f.write("\n?>"); f.close() -- cgit v1.2.3-24-g4f1b