diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-04-21 10:42:52 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-04-21 10:42:52 -0700 |
commit | 8fe3ee67adcd2ee9372c7044fa311ce55eb285b4 (patch) | |
tree | de9808909692a95575e34d29cf0eb5b832b5c851 | |
parent | 0b17b4331087224883878e49342037bf69717b62 (diff) | |
parent | cbcfd4e3ea9db3125619591b942f56d0a8f3ef48 (diff) | |
download | git-8fe3ee67adcd2ee9372c7044fa311ce55eb285b4.tar.gz |
Merge branch 'jx/i18n'
* jx/i18n:
i18n: mention "TRANSLATORS:" marker in Documentation/CodingGuidelines
i18n: only extract comments marked with "TRANSLATORS:"
i18n: remove obsolete comments for translators in diffstat generation
i18n: fix uncatchable comments for translators in date.c
-rw-r--r-- | Documentation/CodingGuidelines | 10 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | builtin/init-db.c | 8 | ||||
-rw-r--r-- | date.c | 2 | ||||
-rw-r--r-- | diff.c | 8 |
5 files changed, 15 insertions, 15 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index dab5c61bfe..f424dbd75c 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. @@ -2102,7 +2102,7 @@ pdf: XGETTEXT_FLAGS = \ --force-po \ - --add-comments \ + --add-comments=TRANSLATORS: \ --msgid-bugs-address="Git Mailing List <git@vger.kernel.org>" \ --from-code=UTF-8 XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --language=C \ diff --git a/builtin/init-db.c b/builtin/init-db.c index c7c76bbf21..56f85e239a 100644 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@ -412,11 +412,9 @@ int init_db(const char *template_dir, unsigned int flags) if (!(flags & INIT_DB_QUIET)) { int len = strlen(git_dir); - /* - * TRANSLATORS: The first '%s' is either "Reinitialized - * existing" or "Initialized empty", the second " shared" or - * "", and the last '%s%s' is the verbatim directory name. - */ + /* TRANSLATORS: The first '%s' is either "Reinitialized + existing" or "Initialized empty", the second " shared" or + "", and the last '%s%s' is the verbatim directory name. */ printf(_("%s%s Git repository in %s%s\n"), reinit ? _("Reinitialized existing") : _("Initialized empty"), shared_repository ? _(" shared") : "", @@ -144,8 +144,8 @@ void show_date_relative(unsigned long time, int tz, if (months) { struct strbuf sb = STRBUF_INIT; strbuf_addf(&sb, Q_("%lu year", "%lu years", years), years); - /* TRANSLATORS: "%s" is "<n> years" */ strbuf_addf(timebuf, + /* TRANSLATORS: "%s" is "<n> years" */ Q_("%s, %lu month ago", "%s, %lu months ago", months), sb.buf, months); strbuf_release(&sb); @@ -1461,20 +1461,12 @@ int print_stat_summary(FILE *fp, int files, int insertions, int deletions) * but nothing about added/removed lines? Is this a bug in Git?"). */ if (insertions || deletions == 0) { - /* - * TRANSLATORS: "+" in (+) is a line addition marker; - * do not translate it. - */ strbuf_addf(&sb, (insertions == 1) ? ", %d insertion(+)" : ", %d insertions(+)", insertions); } if (deletions || insertions == 0) { - /* - * TRANSLATORS: "-" in (-) is a line removal marker; - * do not translate it. - */ strbuf_addf(&sb, (deletions == 1) ? ", %d deletion(-)" : ", %d deletions(-)", deletions); |