[issue36239] gettext: GNUTranslations doesn't parse properly comments in description

Julien Palard report at bugs.python.org
Fri Mar 8 09:43:54 EST 2019


Julien Palard <julien+python at palard.fr> added the comment:

After some research I found a few comments around comments being marked as starting by #-#-#-#-# and ending with #-#-#-#-#, not just starting with #.

In gettext-0.19.8.1 sources for example:

$ grep -r '#-#-#-#-' | head
gettext-tools/misc/po-mode.el:#-#-#-#-#  file name reference  #-#-#-#-#
gettext-tools/misc/po-mode.el:  (let* ((marker-regex "^#-#-#-#-#  \\(.*\\)  #-#-#-#-#\n")
gettext-tools/src/msgl-cat.c:                  char *id = xasprintf ("#-#-#-#-#  %s  #-#-#-#-#",

Or more precisly in `gettext-tools/tests/msgcat-10`:

# Verify msgcat of two files, when the header entries have different comments
# but the same contents. The resulting header entry is not marked fuzzy,
# because the #-#-#-#-# are only in comments and do not necessarily require
# translator attention; in other words, an msgstr which is valid in both input
# files is also valid in the result.

I'm however surprised not to find much of "#-#-#-#-#" in the source code, like if they are just looking a single # like you do here.

Not sure which one is the better, eliminating lines with a pair of #-#-#-#-# or lines starting with a #, both looks OK to me (we're only speaking about the header here, not the msgstr, so it won't have much impact).

Personally I'd go for eliminating #-#-#-#-# as this is the only case we've seen, and is the "documented" one in the GNU gettext test cases.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36239>
_______________________________________


More information about the Python-bugs-list mailing list