i18n: notes: mark strings for translation
authorVasco Almeida <vascomalmeida@sapo.pt>
Fri, 17 Jun 2016 20:21:14 +0000 (20:21 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 Jun 2016 22:45:49 +0000 (15:45 -0700)
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>
builtin/notes.c
t/t3310-notes-merge-manual-resolve.sh
t/t3320-notes-merge-worktrees.sh
index c65b59ad9a340e9b68e4d09ea8912499227fce66..d11e6eb531a91a0c98e7c7f9feade4324179b314 100644 (file)
@@ -749,7 +749,7 @@ static int git_config_get_notes_strategy(const char *key,
        if (git_config_get_string(key, &value))
                return 1;
        if (parse_notes_merge_strategy(value, strategy))
-               git_die_config(key, "unknown notes merge strategy %s", value);
+               git_die_config(key, _("unknown notes merge strategy %s"), value);
 
        free(value);
        return 0;
@@ -788,15 +788,15 @@ static int merge(int argc, const char **argv, const char *prefix)
        if (strategy || do_commit + do_abort == 0)
                do_merge = 1;
        if (do_merge + do_commit + do_abort != 1) {
-               error("cannot mix --commit, --abort or -s/--strategy");
+               error(_("cannot mix --commit, --abort or -s/--strategy"));
                usage_with_options(git_notes_merge_usage, options);
        }
 
        if (do_merge && argc != 1) {
-               error("Must specify a notes ref to merge");
+               error(_("Must specify a notes ref to merge"));
                usage_with_options(git_notes_merge_usage, options);
        } else if (!do_merge && argc) {
-               error("too many parameters");
+               error(_("too many parameters"));
                usage_with_options(git_notes_merge_usage, options);
        }
 
@@ -817,7 +817,7 @@ static int merge(int argc, const char **argv, const char *prefix)
 
        if (strategy) {
                if (parse_notes_merge_strategy(strategy, &o.strategy)) {
-                       error("Unknown -s/--strategy: %s", strategy);
+                       error(_("Unknown -s/--strategy: %s"), strategy);
                        usage_with_options(git_notes_merge_usage, options);
                }
        } else {
@@ -857,11 +857,11 @@ static int merge(int argc, const char **argv, const char *prefix)
                        die(_("A notes merge into %s is already in-progress at %s"),
                            default_notes_ref(), wt->path);
                if (create_symref("NOTES_MERGE_REF", default_notes_ref(), NULL))
-                       die("Failed to store link to current notes ref (%s)",
+                       die(_("Failed to store link to current notes ref (%s)"),
                            default_notes_ref());
-               printf("Automatic notes merge failed. Fix conflicts in %s and "
-                      "commit the result with 'git notes merge --commit', or "
-                      "abort the merge with 'git notes merge --abort'.\n",
+               printf(_("Automatic notes merge failed. Fix conflicts in %s and "
+                        "commit the result with 'git notes merge --commit', or "
+                        "abort the merge with 'git notes merge --abort'.\n"),
                       git_path(NOTES_MERGE_WORKTREE));
        }
 
@@ -964,7 +964,7 @@ static int get_ref(int argc, const char **argv, const char *prefix)
                             git_notes_get_ref_usage, 0);
 
        if (argc) {
-               error("too many parameters");
+               error(_("too many parameters"));
                usage_with_options(git_notes_get_ref_usage, options);
        }
 
index d5572121da69a90ffb1010b6136c3c1fa9fe07f2..696743632729f6f7a244606adb4e1b0de9beeb7f 100755 (executable)
@@ -178,7 +178,7 @@ test_expect_success 'merge z into m (== y) with default ("manual") resolver => C
        git config core.notesRef refs/notes/m &&
        test_must_fail git notes merge z >output &&
        # Output should point to where to resolve conflicts
-       grep -q "\\.git/NOTES_MERGE_WORKTREE" output &&
+       test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output &&
        # Inspect merge conflicts
        ls .git/NOTES_MERGE_WORKTREE >output_conflicts &&
        test_cmp expect_conflicts output_conflicts &&
@@ -381,7 +381,7 @@ test_expect_success 'redo merge of z into m (== y) with default ("manual") resol
        git config core.notesRef refs/notes/m &&
        test_must_fail git notes merge z >output &&
        # Output should point to where to resolve conflicts
-       grep -q "\\.git/NOTES_MERGE_WORKTREE" output &&
+       test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output &&
        # Inspect merge conflicts
        ls .git/NOTES_MERGE_WORKTREE >output_conflicts &&
        test_cmp expect_conflicts output_conflicts &&
@@ -415,7 +415,7 @@ git rev-parse refs/notes/z > pre_merge_z
 test_expect_success 'redo merge of z into m (== y) with default ("manual") resolver => Conflicting 3-way merge' '
        test_must_fail git notes merge z >output &&
        # Output should point to where to resolve conflicts
-       grep -q "\\.git/NOTES_MERGE_WORKTREE" output &&
+       test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output &&
        # Inspect merge conflicts
        ls .git/NOTES_MERGE_WORKTREE >output_conflicts &&
        test_cmp expect_conflicts output_conflicts &&
@@ -496,7 +496,7 @@ test_expect_success 'redo merge of z into m (== y) with default ("manual") resol
        git update-ref refs/notes/m refs/notes/y &&
        test_must_fail git notes merge z >output &&
        # Output should point to where to resolve conflicts
-       grep -q "\\.git/NOTES_MERGE_WORKTREE" output &&
+       test_i18ngrep "\\.git/NOTES_MERGE_WORKTREE" output &&
        # Inspect merge conflicts
        ls .git/NOTES_MERGE_WORKTREE >output_conflicts &&
        test_cmp expect_conflicts output_conflicts &&
index 522157b76461cfd781cb69dc1ce8bddb2a03517e..6e0511596b0cea176cf19566a90971d8f0196253 100755 (executable)
@@ -62,7 +62,7 @@ test_expect_success 'merge z into x while mid-merge on y succeeds' '
                cd worktree2 &&
                git config core.notesRef refs/notes/x &&
                test_must_fail git notes merge z 2>&1 >out &&
-               grep "Automatic notes merge failed" out &&
+               test_i18ngrep "Automatic notes merge failed" out &&
                grep -v "A notes merge into refs/notes/x is already in-progress in" out
        ) &&
        echo "ref: refs/notes/x" >expect &&