From: Junio C Hamano <gitster@pobox.com>
To: Jiang Xin <worldhello.net@gmail.com>
Cc: Brian Gesiak <modocache@gmail.com>, Git List <git@vger.kernel.org>
Subject: Re: [PATCH 2/3] i18n: Only extract comments marked by special tag
Date: Fri, 18 Apr 2014 09:52:06 -0700 [thread overview]
Message-ID: <xmqqha5qd1hl.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CANYiYbGkjpdrzE25iRS33sm1=AodiREqWmJVkKVEok4mb4G5mQ@mail.gmail.com> (Jiang Xin's message of "Fri, 18 Apr 2014 14:03:06 +0800")
Jiang Xin <worldhello.net@gmail.com> writes:
>> I am not very happy with this change, as it would force us to
>> special case "Translators" comment to follow a non-standard
>> multi-line comment formatting convention. Is there a way to tell
>> xgettext to accept both of these forms?
>>
>> /* TRANSLATORS: this is a short comment to help you */
>> _("foo bar");
>>
>> /*
>> * TRANSLATORS: this comment is to help you, but it is
>> * a lot longer to fit on just a single line.
>> */
>> _("bar baz");
>>
>
> We can not provide multiple `--add-comments=TAG` options to xgettext,
> because xgettext holds the tag in one string, not in a list:
>
> /* Tag used in comment of prevailing domain. */
> static char *comment_tag;
>
> So if we won't change our multi-line comments for translators, must
> hack gettext in some ways.
>
> There maybe 3 ways to hack gettext:
> ...
> I CC this mail to the gettext mailing list. Full thread see:
>
> * http://thread.gmane.org/gmane.comp.version-control.git/246390/focus=246431
This is one of these times when I find myself very fortunate for
being surrounded by competent contributors with good tastes, which I
may not deserve ;-)
Thanks for being thorough.
Having said that, it is only just a single comment, and it is too
much hassle to even think about what to do in the meantime while we
wait until such a change happens and an updated version of gettext
reaches everybody. Let's take 2/3 as-is.
Documentation/CodingGuidelines may want to have a sentence of two to
explain this, though.
Documentation/CodingGuidelines | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index dab5c61..b367a85 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -159,10 +159,19 @@ For C programs:
- Multi-line comments include their delimiters on separate lines from
the text. E.g.
/*
* A very long
* multi-line comment.
*/
+ Note however that a multi-line comment that explains a translatable
+ string to translators uses a different convention of starting with a
+ magic token "TRANSLATORS: " immediately after the opening delimiter,
+ and without an asterisk at the beginning of each line. E.g.
+
+ /* TRANSLATORS: here is a comment that explains the string
+ to be translated, that follows immediately after it */
+ _("Here is a translatable string explained by the above.");
+
- Double negation is often harder to understand than no negation
at all.
next prev parent reply other threads:[~2014-04-18 16:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-16 22:51 [l10n] date: Note for translators not included in .po files Brian Gesiak
2014-04-17 1:41 ` Jiang Xin
2014-04-17 5:37 ` [PATCH 0/3] extract proper comments for l10n translators Jiang Xin
2014-04-17 5:50 ` Jiang Xin
2014-04-17 18:12 ` Junio C Hamano
2014-04-17 5:37 ` [PATCH 1/3] i18n: Fixes uncatchable comments for translators Jiang Xin
2014-04-17 5:37 ` [PATCH 2/3] i18n: Only extract comments marked by special tag Jiang Xin
2014-04-17 18:08 ` Junio C Hamano
2014-04-18 6:03 ` Jiang Xin
2014-04-18 16:52 ` Junio C Hamano [this message]
2014-04-18 17:48 ` Junio C Hamano
2014-04-17 5:37 ` [PATCH 3/3] i18n: Remove obsolete comments for translators Jiang Xin
2014-04-17 6:27 ` [l10n] date: Note for translators not included in .po files Jiang Xin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqha5qd1hl.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=modocache@gmail.com \
--cc=worldhello.net@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).