After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 765778 - unescaped soft hyphen in POT confuses translators
unescaped soft hyphen in POT confuses translators
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-28 20:09 UTC by Mingye Wang
Modified: 2018-01-18 02:02 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mingye Wang 2016-04-28 20:09:21 UTC
There are a few soft hyphens in the POT, e.g. "Pri-va-cy" (substituted with normal hyphens). Translators with a Unicode-conforming editor will not be able to see such characters, hence they will not add soft hyphens for their languages accordingly.

A comment should be added for such strings. If GNU gettext allows using escapes (msgcat -E) for only some of the messages, that would be even better.

See also: https://github.com/vslavik/poedit/issues/269
Comment 1 Mingye Wang 2016-04-28 20:14:42 UTC
> If GNU gettext....

https://savannah.gnu.org/bugs/index.php?47801
Comment 2 Bastien Nocera 2016-04-28 21:38:34 UTC
There's a translator comment for every one of those strings:
https://git.gnome.org/browse/gnome-control-center/commit/?id=b3be07609a9bae43947ee3e59d8982a7715c9acf

But gettext only took the last line.

commit 5c10ce45b8f2902e71a36649b9d0a31ccff6dc0f
Author: Bastien Nocera <hadess@hadess.net>
Date:   Thu Apr 28 23:36:30 2016 +0200

    panels: Fix translators comments being truncated
    
    Commit b3be076 added soft hyphens along with a comment for translators
    to use those soft hyphens. Except that gettext would only grab the one
    line out of the four we wrote for translators to read. Put them all on
    the same line so that gettext actually extracts those.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=765778
Comment 3 Bruno Haible 2016-04-30 14:44:27 UTC
> There are a few soft hyphens in the POT

Translators should not see such characters, because soft hyphens in the msgid
strings are meant for *rendering* the untranslated English strings.
They have no importance to the translator.

> hence they will not add soft hyphens for their languages accordingly.

If that is what you want to achieve, it is an invalid use of soft hyphens,
because sometimes the English word consists only of one syllable, without
the possibility to insert a soft hyphen. A translator comment is the
right solution for this type of information.

> Except that gettext would only grab the one line out of the four
> we wrote for translators to read.

Yes, you would have to repeat the prefix "# Translators:" on each of the
lines.
Comment 4 Mingye Wang 2016-05-01 08:22:56 UTC
>> Except that gettext would only grab the one line out of the four
>> we wrote for translators to read.
> Yes, you would have to repeat the prefix "# Translators:" on each of the
lines.

This doesn't seem to be the case in gettext doc: https://www.gnu.org/software/gettext/manual/gettext.html#Bug-Report-Address

The handling of comments in GnuPG trustdb.c:uid_trust_string_fixed matches the gettext doc example.
Comment 5 Bruno Haible 2016-05-01 11:27:51 UTC
>> Yes, you would have to repeat the prefix "# Translators:" on each of the
>> lines.
> This doesn't seem to be the case in gettext doc

You're right. It was in xgettext version 0.10.40 that the prefix "# Translators:"
has to appear on each line. This was corrected in the xgettext version 0.11.5,
back in 2002.

To convince yourself, use an extraction command such as
$ xgettext -o - -k_ --add-comments="TRANSLATORS:" foo.c

I conclude that the need for commit 5c10ce45b8f2902e71a36649b9d0a31ccff6dc0f
must come from a GNOME specific tool, not from the GNU gettext tools.
Comment 6 Mingye Wang 2016-05-03 16:25:39 UTC
> I conclude that the need for commit 5c10ce45b8f2902e71a36649b9d0a31ccff6dc0f
> must come from a GNOME specific tool, not from the GNU gettext tools.

Yes, this is an inittool thing. It seems that they are only matching a single line of comment in type_ini by doing /^(#(.+)\n)?^_[A-Za-z0-9\-]+\s*=\s*(.*)$/mg. I have added a comment to https://bugs.launchpad.net/intltool/+bug/410972.