From: Ævar Arnfjörð Bjarmason Date: Sun, 5 Sep 2010 14:02:13 +0000 (+0000) Subject: gettextize: git-notes "Refusing to %s notes in %s" message X-Git-Tag: ko-pu~10^2~73 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=103d6c27e458a36ba281b9ea80d8a4cb1141951b;p=git.git gettextize: git-notes "Refusing to %s notes in %s" message The first %s in "Refusing to %s notes in %s" is one of "git notes ACTION". So we need to mark those actions for translation and later use _(). Also add a TRANSLATORS comment explaining to translators what the first %s means. Signed-off-by: Ævar Arnfjörð Bjarmason --- diff --git a/builtin/notes.c b/builtin/notes.c index 6aa9f5ae5..e33e39a50 100644 --- a/builtin/notes.c +++ b/builtin/notes.c @@ -476,8 +476,10 @@ static struct notes_tree *init_notes_check(const char *subcommand) t = &default_notes_tree; if (prefixcmp(t->ref, "refs/notes/")) - die("Refusing to %s notes in %s (outside of refs/notes/)", - subcommand, t->ref); + /* TRANSLATORS: The first %s is one of "git notes ACTION", + e.g. "add", "copy", "append" etc. */ + die(_("Refusing to %s notes in %s (outside of refs/notes/)"), + _(subcommand), t->ref); return t; } @@ -500,7 +502,7 @@ static int list(int argc, const char **argv, const char *prefix) usage_with_options(git_notes_list_usage, options); } - t = init_notes_check("list"); + t = init_notes_check(N_("list")); if (argc) { if (get_sha1(argv[0], object)) die(_("Failed to resolve '%s' as a valid ref."), argv[0]); @@ -557,7 +559,7 @@ static int add(int argc, const char **argv, const char *prefix) if (get_sha1(object_ref, object)) die(_("Failed to resolve '%s' as a valid ref."), object_ref); - t = init_notes_check("add"); + t = init_notes_check(N_("add")); note = get_note(t, object); if (note) { @@ -633,7 +635,7 @@ static int copy(int argc, const char **argv, const char *prefix) if (get_sha1(object_ref, object)) die(_("Failed to resolve '%s' as a valid ref."), object_ref); - t = init_notes_check("copy"); + t = init_notes_check(N_("copy")); note = get_note(t, object); if (note) { @@ -749,7 +751,7 @@ static int show(int argc, const char **argv, const char *prefix) if (get_sha1(object_ref, object)) die(_("Failed to resolve '%s' as a valid ref."), object_ref); - t = init_notes_check("show"); + t = init_notes_check(N_("show")); note = get_note(t, object); if (!note) @@ -786,7 +788,7 @@ static int remove_cmd(int argc, const char **argv, const char *prefix) if (get_sha1(object_ref, object)) die(_("Failed to resolve '%s' as a valid ref."), object_ref); - t = init_notes_check("remove"); + t = init_notes_check(N_("remove")); retval = remove_note(t, object); if (retval) @@ -820,7 +822,7 @@ static int prune(int argc, const char **argv, const char *prefix) usage_with_options(git_notes_prune_usage, options); } - t = init_notes_check("prune"); + t = init_notes_check(N_("prune")); prune_notes(t, (verbose ? NOTES_PRUNE_VERBOSE : 0) | (show_only ? NOTES_PRUNE_VERBOSE|NOTES_PRUNE_DRYRUN : 0) );