git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v5 17/38] i18n: setup: mark strings for translation

From
Vasco Almeida <vascomalmeida@sapo.pt>
Date
Jun 17, 2016, 20:21 UTC
Message-ID
<1466194887-18236-18-git-send-email-vascomalmeida@sapo.pt>
In-Reply-To
<1466194887-18236-1-git-send-email-vascomalmeida@sapo.pt>

Update tests that compare the strings newly marked for translation to succeed when running under GETTEXT_POISON.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 setup.c                        | 16 ++++++++--------
 t/t1506-rev-parse-diagnosis.sh |  2 +-
 t/t4208-log-magic-pathspec.sh  |  4 ++--
 3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/setup.c b/setup.c
index c86bf5c..6d0e0c9 100644
--- a/setup.c
+++ b/setup.c
@@ -157,8 +157,8 @@ static void NORETURN die_verify_filename(const char *prefix,
 					 int diagnose_misspelt_rev)
 {
 	if (!diagnose_misspelt_rev)
-		die("%s: no such path in the working tree.\n"
-		    "Use 'git <command> -- <path>...' to specify paths that do not exist locally.",
+		die(_("%s: no such path in the working tree.\n"
+		      "Use 'git <command> -- <path>...' to specify paths that do not exist locally."),
 		    arg);
 	/*
 	 * Saying "'(icase)foo' does not exist in the index" when the
@@ -170,9 +170,9 @@ static void NORETURN die_verify_filename(const char *prefix,
 		maybe_die_on_misspelt_object_name(arg, prefix);
 
 	/* ... or fall back the most general message. */
-	die("ambiguous argument '%s': unknown revision or path not in the working tree.\n"
-	    "Use '--' to separate paths from revisions, like this:\n"
-	    "'git <command> [<revision>...] -- [<file>...]'", arg);
+	die(_("ambiguous argument '%s': unknown revision or path not in the working tree.\n"
+	      "Use '--' to separate paths from revisions, like this:\n"
+	      "'git <command> [<revision>...] -- [<file>...]'"), arg);
 
 }
 
@@ -220,9 +220,9 @@ void verify_non_filename(const char *prefix, const char *arg)
 		return; /* flag */
 	if (!check_filename(prefix, arg))
 		return;
-	die("ambiguous argument '%s': both revision and filename\n"
-	    "Use '--' to separate paths from revisions, like this:\n"
-	    "'git <command> [<revision>...] -- [<file>...]'", arg);
+	die(_("ambiguous argument '%s': both revision and filename\n"
+	      "Use '--' to separate paths from revisions, like this:\n"
+	      "'git <command> [<revision>...] -- [<file>...]'"), arg);
 }
 
 int get_common_dir(struct strbuf *sb, const char *gitdir)
diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh
index 86c2ff2..79a0251 100755
--- a/t/t1506-rev-parse-diagnosis.sh
+++ b/t/t1506-rev-parse-diagnosis.sh
@@ -106,7 +106,7 @@ test_expect_success 'incorrect revision id' '
 	test_must_fail git rev-parse foobar:file.txt 2>error &&
 	grep "Invalid object name '"'"'foobar'"'"'." error &&
 	test_must_fail git rev-parse foobar 2> error &&
-	grep "unknown revision or path not in the working tree." error
+	test_i18ngrep "unknown revision or path not in the working tree." error
 '
 
 test_expect_success 'incorrect file in sha1:path' '
diff --git a/t/t4208-log-magic-pathspec.sh b/t/t4208-log-magic-pathspec.sh
index d8f23f4..001343e 100755
--- a/t/t4208-log-magic-pathspec.sh
+++ b/t/t4208-log-magic-pathspec.sh
@@ -18,7 +18,7 @@ test_expect_success '"git log :/" should not be ambiguous' '
 test_expect_success '"git log :/a" should be ambiguous (applied both rev and worktree)' '
 	: >a &&
 	test_must_fail git log :/a 2>error &&
-	grep ambiguous error
+	test_i18ngrep ambiguous error
 '
 
 test_expect_success '"git log :/a -- " should not be ambiguous' '
@@ -31,7 +31,7 @@ test_expect_success '"git log -- :/a" should not be ambiguous' '
 
 test_expect_success '"git log :" should be ambiguous' '
 	test_must_fail git log : 2>error &&
-	grep ambiguous error
+	test_i18ngrep ambiguous error
 '
 
 test_expect_success 'git log -- :' '
-- 
2.6.6
Previous: Vasco AlmeidaNext: Vasco Almeida
Message 13 of 41 in “i18n and test updates”
  1. 00/38 i18n and test updatesVasco Almeida, Jun 17, 2016
  2. 01/38 i18n: builtin/remote.c: fix mark for translationVasco Almeida, Jun 17, 2016
  3. 02/38 i18n: advice: mark string about detached head for translationVasco Almeida, Jun 17, 2016
  4. 03/38 i18n: advice: internationalize message for conflictsVasco Almeida, Jun 17, 2016
  5. 04/38 i18n: transport: mark strings for translationVasco Almeida, Jun 17, 2016
  6. 05/38 i18n: sequencer: mark entire sentences for translationVasco Almeida, Jun 17, 2016
  7. 06/38 i18n: sequencer: mark string for translationVasco Almeida, Jun 17, 2016
  8. 07/38 i18n: merge-octopus: mark messages for translationVasco Almeida, Jun 17, 2016
  9. 08/38 merge-octupus: use die shell function from git-sh-setup.shVasco Almeida, Jun 17, 2016
  10. 09/38 i18n: rebase: fix marked string to use eval_gettext variantVasco Almeida, Jun 17, 2016
  11. 12/38 t6030: update to use test_i18ncmpVasco Almeida, Jun 17, 2016
  12. 11/38 i18n: bisect: simplify error message for i18nVasco Almeida, Jun 17, 2016
  13. 17/38 i18n: setup: mark strings for translationVasco Almeida, Jun 17, 2016
  14. 14/38 i18n: rebase-interactive: mark strings for translationVasco Almeida, Jun 17, 2016
  15. 22/38 t5523: use test_i18ngrep for negationVasco Almeida, Jun 17, 2016
  16. 20/38 t9003: become resilient to GETTEXT_POISONVasco Almeida, Jun 17, 2016
  17. 28/38 i18n: merge: mark messages for translationVasco Almeida, Jun 17, 2016
  18. 31/38 i18n: standardise messagesVasco Almeida, Jun 17, 2016
  19. 33/38 i18n: remote: allow translations to reorder messageVasco Almeida, Jun 17, 2016
  20. 30/38 i18n: sequencer: add period to error messageVasco Almeida, Jun 17, 2016
  21. 32/38 i18n: remote: mark URL fallback text for translationVasco Almeida, Jun 17, 2016
  22. 27/38 i18n: config: unfold error messages marked for translationVasco Almeida, Jun 17, 2016
  23. 29/38 i18n: merge: change command option help to lowercaseVasco Almeida, Jun 17, 2016
  24. 23/38 i18n: bisect: mark strings for translationVasco Almeida, Jun 17, 2016
  25. 24/38 i18n: transport-helper.c: change N_() call to _()Vasco Almeida, Jun 17, 2016
  26. 26/38 i18n: notes: mark options for translationVasco Almeida, Jun 17, 2016
  27. 18/38 tests: use test_i18n* functions to suppress false positivesVasco Almeida, Jun 17, 2016
  28. 21/38 t4153: fix negated test_i18ngrep callVasco Almeida, Jun 17, 2016
  29. 25/38 i18n: notes: mark strings for translationVasco Almeida, Jun 17, 2016
  30. 19/38 tests: unpack-trees: update to use test_i18n* functionsVasco Almeida, Jun 17, 2016
  31. 15/38 i18n: rebase-interactive: mark here-doc strings for translationVasco Almeida, Jun 17, 2016
  32. 10/38 i18n: rebase: mark placeholder for translationVasco Almeida, Jun 17, 2016
  33. 13/38 i18n: git-sh-setup.sh: mark strings for translationVasco Almeida, Jun 17, 2016
  34. 16/38 i18n: rebase-interactive: mark comments of squash for translationVasco Almeida, Jun 17, 2016
  35. Junio C HamanoJun 17, 2016
  36. Junio C HamanoJun 17, 2016
  37. 34/38 i18n: init-db: join message piecesVasco Almeida, Jun 17, 2016
  38. 36/38 i18n: submodule: escape shell variables inside eval_gettextVasco Almeida, Jun 17, 2016
  39. 37/38 i18n: unmark die messages for translationVasco Almeida, Jun 17, 2016
  40. 35/38 i18n: submodule: join strings marked for translationVasco Almeida, Jun 17, 2016
  41. 38/38 i18n: branch: mark comment when editing branch description for translationVasco Almeida, Jun 17, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.