git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/3] i18n: Only extract comments marked by special tag

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 18, 2014, 17:48 UTC
Message-ID
<xmqqy4z2bkbr.fsf@gitster.dls.corp.google.com>
In-Reply-To
<xmqqha5qd1hl.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
> Documentation/CodingGuidelines may want to have a sentence of two to
> explain this, though.

After re-reading what I sent out, I realized that the way I singled out multi-line comments was misleading. Here is an updated version.

-- >8 --
Subject: [PATCH] i18n: mention "TRANSLATORS:" marker in Documentation/CodingGuidelines

These comments have to have "TRANSLATORS: " at the very beginning and have to deviate from the usual multi-line comment formatting convention.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/CodingGuidelines | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index dab5c61..f9b8bff 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -164,6 +164,16 @@ For C programs:
 	 * multi-line comment.
 	 */
 
+   Note however that a comment that explains a translatable string to
+   translators uses a convention of starting with a magic token
+   "TRANSLATORS: " immediately after the opening delimiter, even when
+   it spans multiple lines.  We do not add an asterisk at the beginning
+   of each line, either.  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.
 
-- 
1.9.2-651-g78816bc
Previous: Junio C HamanoNext: Jiang Xin
Message 9 of 13 in “[l10n] date: Note for translators not included in .po files”
  1. Brian GesiakApr 16, 2014
  2. Jiang XinApr 17, 2014
  3. 0/3 extract proper comments for l10n translatorsJiang Xin, Apr 17, 2014
  4. 1/3 i18n: Fixes uncatchable comments for translatorsJiang Xin, Apr 17, 2014
  5. 2/3 i18n: Only extract comments marked by special tagJiang Xin, Apr 17, 2014
  6. Junio C HamanoApr 17, 2014
  7. Jiang XinApr 18, 2014
  8. Junio C HamanoApr 18, 2014
  9. Junio C HamanoApr 18, 2014
  10. 3/3 i18n: Remove obsolete comments for translatorsJiang Xin, Apr 17, 2014
  11. Jiang XinApr 17, 2014
  12. Junio C HamanoApr 17, 2014
  13. Jiang XinApr 17, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.