i18n: notes: mark strings for translation

Mark strings of messages for the user as translatable. Update tests t3310-notes-merge-manual-resolve.sh and t3320-notes-merge-worktrees.sh to reflect new translatable messages. Tests that grep for .git/NOTES_MERGE_WORKTREE reflect the translatable string "Automatic notes merge failed. Fix conflicts in %s and [...]". Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Vasco Almeida committed Jun 17, 2016 at 20:21 UTC 5313827f7eb5a54391da357ae01f2651fde28c8f
3 files changed +15 -15
builtin/notes.c
+10 -10
@@ -749,7 +749,7 @@ static int git_config_get_notes_strategy(const char *key,
749 if (git_config_get_string(key, &value))
750 return 1;
751 if (parse_notes_merge_strategy(value, strategy))
752 - git_die_config(key, "unknown notes merge strategy %s", value);
752 + git_die_config(key, _("unknown notes merge strategy %s"), value);
753
754 free(value);
755 return 0;
@@ -788,15 +788,15 @@ static int merge(int argc, const char **argv, const char *prefix)
788 if (strategy || do_commit + do_abort == 0)
789 do_merge = 1;
790 if (do_merge + do_commit + do_abort != 1) {
791 - error("cannot mix --commit, --abort or -s/--strategy");
791 + error(_("cannot mix --commit, --abort or -s/--strategy"));
792 usage_with_options(git_notes_merge_usage, options);
793 }
794
795 if (do_merge && argc != 1) {
796 - error("Must specify a notes ref to merge");
796 + error(_("Must specify a notes ref to merge"));
797 usage_with_options(git_notes_merge_usage, options);
798 } else if (!do_merge && argc) {
799 - error("too many parameters");
799 + error(_("too many parameters"));
800 usage_with_options(git_notes_merge_usage, options);
801 }
802
@@ -817,7 +817,7 @@ static int merge(int argc, const char **argv, const char *prefix)
817
818 if (strategy) {
819 if (parse_notes_merge_strategy(strategy, &o.strategy)) {
820 - error("Unknown -s/--strategy: %s", strategy);
820 + error(_("Unknown -s/--strategy: %s"), strategy);
821 usage_with_options(git_notes_merge_usage, options);
822 }
823 } else {
@@ -857,11 +857,11 @@ static int merge(int argc, const char **argv, const char *prefix)
857 die(_("A notes merge into %s is already in-progress at %s"),
858 default_notes_ref(), wt->path);
859 if (create_symref("NOTES_MERGE_REF", default_notes_ref(), NULL))
860 - die("Failed to store link to current notes ref (%s)",
860 + die(_("Failed to store link to current notes ref (%s)"),
861 default_notes_ref());
862 - printf("Automatic notes merge failed. Fix conflicts in %s and "
863 - "commit the result with 'git notes merge --commit', or "
864 - "abort the merge with 'git notes merge --abort'.\n",
862 + printf(_("Automatic notes merge failed. Fix conflicts in %s and "
863 + "commit the result with 'git notes merge --commit', or "
864 + "abort the merge with 'git notes merge --abort'.\n"),
865 git_path(NOTES_MERGE_WORKTREE));
866 }
867
@@ -964,7 +964,7 @@ static int get_ref(int argc, const char **argv, const char *prefix)
964 git_notes_get_ref_usage, 0);
965
966 if (argc) {
967 - error("too many parameters");
967 + error(_("too many parameters"));
968 usage_with_options(git_notes_get_ref_usage, options);
969 }
970
t/t3310-notes-merge-manual-resolve.sh
+4 -4
@@ -178,7 +178,7 @@ test_expect_success 'merge z into m (== y) with default ("manual") resolver => C
178 git config core.notesRef refs/notes/m &&
179 test_must_fail git notes merge z >output &&
180 # Output should point to where to resolve conflicts
181 - grep -q "\\.git/NOTES_MERGE_WORKTREE" output &&
181 + test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output &&
182 # Inspect merge conflicts
183 ls .git/NOTES_MERGE_WORKTREE >output_conflicts &&
184 test_cmp expect_conflicts output_conflicts &&
@@ -381,7 +381,7 @@ test_expect_success 'redo merge of z into m (== y) with default ("manual") resol
381 git config core.notesRef refs/notes/m &&
382 test_must_fail git notes merge z >output &&
383 # Output should point to where to resolve conflicts
384 - grep -q "\\.git/NOTES_MERGE_WORKTREE" output &&
384 + test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output &&
385 # Inspect merge conflicts
386 ls .git/NOTES_MERGE_WORKTREE >output_conflicts &&
387 test_cmp expect_conflicts output_conflicts &&
@@ -415,7 +415,7 @@ git rev-parse refs/notes/z > pre_merge_z
415 test_expect_success 'redo merge of z into m (== y) with default ("manual") resolver => Conflicting 3-way merge' '
416 test_must_fail git notes merge z >output &&
417 # Output should point to where to resolve conflicts
418 - grep -q "\\.git/NOTES_MERGE_WORKTREE" output &&
418 + test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output &&
419 # Inspect merge conflicts
420 ls .git/NOTES_MERGE_WORKTREE >output_conflicts &&
421 test_cmp expect_conflicts output_conflicts &&
@@ -496,7 +496,7 @@ test_expect_success 'redo merge of z into m (== y) with default ("manual") resol
496 git update-ref refs/notes/m refs/notes/y &&
497 test_must_fail git notes merge z >output &&
498 # Output should point to where to resolve conflicts
499 - grep -q "\\.git/NOTES_MERGE_WORKTREE" output &&
499 + test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output &&
500 # Inspect merge conflicts
501 ls .git/NOTES_MERGE_WORKTREE >output_conflicts &&
502 test_cmp expect_conflicts output_conflicts &&
t/t3320-notes-merge-worktrees.sh
+1 -1
@@ -62,7 +62,7 @@ test_expect_success 'merge z into x while mid-merge on y succeeds' '
62 cd worktree2 &&
63 git config core.notesRef refs/notes/x &&
64 test_must_fail git notes merge z 2>&1 >out &&
65 - grep "Automatic notes merge failed" out &&
65 + test_i18ngrep "Automatic notes merge failed" out &&
66 grep -v "A notes merge into refs/notes/x is already in-progress in" out
67 ) &&
68 echo "ref: refs/notes/x" >expect &&