summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authortkikuchi2006-01-08 08:18:15 +0000
committertkikuchi2006-01-08 08:18:15 +0000
commit4d3cae1c78b8ccadbe350040f980acb2ac347577 (patch)
tree268924ea48b7d8d66ab0ab8afc0b97a4ad3561d8 /bin
parentd78aad44e2519a312700f0947eaadbd13b32d21f (diff)
downloadmailman-4d3cae1c78b8ccadbe350040f980acb2ac347577.tar.gz
mailman-4d3cae1c78b8ccadbe350040f980acb2ac347577.tar.zst
mailman-4d3cae1c78b8ccadbe350040f980acb2ac347577.zip
templ2po.py normalization of '\r\n' to '\n'.
templ2pot.py ... associated change. templ2po.py ... bug fix.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/po2templ.py12
-rwxr-xr-xbin/templ2pot.py2
2 files changed, 9 insertions, 5 deletions
diff --git a/bin/po2templ.py b/bin/po2templ.py
index 432c81d28..78e9fc87b 100755
--- a/bin/po2templ.py
+++ b/bin/po2templ.py
@@ -45,6 +45,8 @@ def do_lang(lang):
outfilename = 'templates/%s/%s' % (lang, filename)
continue
if in_template and line.startswith('#,'):
+ if line.strip() == '#, fuzzy':
+ in_template = False
continue
if in_template and line.startswith('msgstr'):
line = line[7:]
@@ -54,23 +56,25 @@ def do_lang(lang):
in_template = False
in_msg = False
if len(msgstr) > 1 and outfilename:
- # exclude no translation ... only one LF.
+ # exclude no translation ... 1 is for LF only
outfile = file(outfilename, 'w')
try:
outfile.write(msgstr)
+ outfile.write('\n')
finally:
outfile.close()
outfilename = ''
msgstr = ''
continue
- msgstr += eval(i)
+ msgstr += eval(line)
finally:
fp.close()
- if msgstr > 1 and outfilename:
- # flush remaining msgstr
+ if len(msgstr) > 1 and outfilename:
+ # flush remaining msgstr (last template file)
outfile = file(outfilename, 'w')
try:
outfile.write(msgstr)
+ outfile.write('\n')
finally:
outfile.close()
diff --git a/bin/templ2pot.py b/bin/templ2pot.py
index 4f027eb08..0253cc2cd 100755
--- a/bin/templ2pot.py
+++ b/bin/templ2pot.py
@@ -74,7 +74,7 @@ def escape(s):
def normalize(s):
# This converts the various Python string types into a format that is
# appropriate for .po files, namely much closer to C style.
- lines = s.split('\n')
+ lines = s.splitlines()
if len(lines) == 1:
s = '"' + escape(s) + '"'
else: