diff options
| author | tkikuchi | 2005-12-06 13:10:27 +0000 |
|---|---|---|
| committer | tkikuchi | 2005-12-06 13:10:27 +0000 |
| commit | 9209d76e9f07069a475835da948b155b8ea8d2cb (patch) | |
| tree | 5dd0922afa0d4c31d4bb70c7af845cb268d135a2 /bin | |
| parent | d667929bf0fac107e9ff596509f98939821743ea (diff) | |
| download | mailman-9209d76e9f07069a475835da948b155b8ea8d2cb.tar.gz mailman-9209d76e9f07069a475835da948b155b8ea8d2cb.tar.zst mailman-9209d76e9f07069a475835da948b155b8ea8d2cb.zip | |
Fix bug in generating the last file.
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/po2templ.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/bin/po2templ.py b/bin/po2templ.py index c92407364..769611e95 100755 --- a/bin/po2templ.py +++ b/bin/po2templ.py @@ -20,7 +20,7 @@ def do_lang(lang): in_template = 1 in_msg = 0 filename = i[16:-3] - outfile = file('templates/%s/%s' % (lang, filename), 'w') + outfilename = 'templates/%s/%s' % (lang, filename) continue if in_template and i.startswith('#,'): continue @@ -31,11 +31,20 @@ def do_lang(lang): if len(i.strip()) == 0: in_template = 0 in_msg = 0 - print >> outfile, msgstr - outfile.close() + if (len(msgstr) > 1) and outfilename: + # exclude no translation ... only one LF. + outfile = file(outfilename, 'w') + print >> outfile, msgstr + outfile.close() + outfilename = '' msgstr = '' continue msgstr += eval(i) + if (msgstr > 1) and outfilename: + # flush remaining msgstr + outfile = file(outfilename, 'w') + print >> outfile, msgstr + outfile.close() if __name__ == '__main__': langs = sys.argv[1:] |
