diff options
author | Barry Warsaw <barry@python.org> | 2001-06-20 19:41:40 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2001-06-20 19:41:40 (GMT) |
commit | 5c94ce58e79f31966ee81dda0965bbe74e0d0cec (patch) | |
tree | cc322ea7bc0b24e32a08ded83ae32823c448a2c7 /Tools/i18n/pygettext.py | |
parent | 6302ec63fc40dd6ae1ad3003003b6b264422e8e0 (diff) | |
download | cpython-5c94ce58e79f31966ee81dda0965bbe74e0d0cec.zip cpython-5c94ce58e79f31966ee81dda0965bbe74e0d0cec.tar.gz cpython-5c94ce58e79f31966ee81dda0965bbe74e0d0cec.tar.bz2 |
write(): Karl Eichwalder points out that the #, flag comments should
be outputted just before the msgid lines.
Diffstat (limited to 'Tools/i18n/pygettext.py')
-rwxr-xr-x | Tools/i18n/pygettext.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Tools/i18n/pygettext.py b/Tools/i18n/pygettext.py index 11ce185..bd9c0bc 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' |