summaryrefslogtreecommitdiff
path: root/Tools/i18n
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2001-06-20 19:41:40 +0000
committerBarry Warsaw <barry@python.org>2001-06-20 19:41:40 +0000
commit17faf4c16edd252122381778a835d5be1a664522 (patch)
tree2d89d2073c7ab5d1a607896de94bd2792e1ee27c /Tools/i18n
parent720189ea0563a60139adbf2b96227d3d9462c32a (diff)
downloadcpython-17faf4c16edd252122381778a835d5be1a664522.tar.gz
write(): Karl Eichwalder points out that the #, flag comments should
be outputted just before the msgid lines.
Diffstat (limited to 'Tools/i18n')
-rwxr-xr-xTools/i18n/pygettext.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Tools/i18n/pygettext.py b/Tools/i18n/pygettext.py
index 11ce185af9..bd9c0bca60 100755
--- a/Tools/i18n/pygettext.py
+++ b/Tools/i18n/pygettext.py
@@ -338,11 +338,12 @@ class TokenEater:
rentries = reverse[rkey]
rentries.sort()
for k, v in rentries:
+ isdocstring = 0
# If the entry was gleaned out of a docstring, then add a
# comment stating so. This is to aid translators who may wish
# to skip translating some unimportant docstrings.
if reduce(operator.__add__, v.values()):
- print >> fp, '#, docstring'
+ isdocstring = 1
# k is the message string, v is a dictionary-set of (filename,
# lineno) tuples. We want to sort the entries in v first by
# file name and then by line number.
@@ -370,6 +371,8 @@ class TokenEater:
locline = "#:" + s
if len(locline) > 2:
print >> fp, locline
+ if isdocstring:
+ print >> fp, '#, docstring'
print >> fp, 'msgid', normalize(k)
print >> fp, 'msgstr ""\n'