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
This commit is contained in:
Junio C Hamano 2014-04-21 10:42:52 -07:00
commit 8fe3ee67ad
5 changed files with 15 additions and 15 deletions

View File

@ -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.

View File

@ -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 \

View File

@ -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") : "",

2
date.c
View File

@ -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);

8
diff.c
View File

@ -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);