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

Re: [PATCH] i18n: unpack-trees: avoid substituting only a verb in sentences

From
Junio C Hamano <gitster@pobox.com>
Date
May 12, 2016, 23:28 UTC
Message-ID
<xmqqoa8ac0v1.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1463094986-7344-1-git-send-email-vascomalmeida@sapo.pt>
Vasco Almeida <vascomalmeida@sapo.pt> writes:
Show 14 quoted lines
> Instead of reusing the same set of message templates for checkout
> and other actions and substituting the verb with "%s", prepare
> separate message templates for each known action. That would make
> it easier for translation into languages where the same verb may
> conjugate differently depending on the message we are giving.
>
> See gettext documentation for details:
> http://www.gnu.org/software/gettext/manual/html_node/Preparing-Strings.html
>
> Helped-by: Junio C Hamano <gitster@pobox.com>
> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
> ---
>
> I removed "Please," in favor of "Please" as Junio C Hamano sugested.

Thanks. I think we should squash the following in, as all these messages are now i18ned and without being marked with test_i18ncmp, GETTEXT_POISON build would fail to pass these tests.

 t/t7609-merge-co-error-msgs.sh | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/t/t7609-merge-co-error-msgs.sh b/t/t7609-merge-co-error-msgs.sh
index 0e4a682..6729cb3 100755
--- a/t/t7609-merge-co-error-msgs.sh
+++ b/t/t7609-merge-co-error-msgs.sh
@@ -37,14 +37,14 @@ EOF
 
 test_expect_success 'untracked files overwritten by merge (fast and non-fast forward)' '
 	test_must_fail git merge branch 2>out &&
-	test_cmp out expect &&
+	test_i18ncmp out expect &&
 	git commit --allow-empty -m empty &&
 	(
 		GIT_MERGE_VERBOSITY=0 &&
 		export GIT_MERGE_VERBOSITY &&
 		test_must_fail git merge branch 2>out2
 	) &&
-	test_cmp out2 expect &&
+	test_i18ncmp out2 expect &&
 	git reset --hard HEAD^
 '
 
@@ -53,7 +53,7 @@ error: Your local changes to the following files would be overwritten by merge:
 	four
 	three
 	two
-Please, commit your changes or stash them before you can merge.
+Please commit your changes or stash them before you can merge.
 error: The following untracked working tree files would be overwritten by merge:
 	five
 Please move or remove them before you can merge.
@@ -65,14 +65,14 @@ test_expect_success 'untracked files or local changes ovewritten by merge' '
 	git add three &&
 	git add four &&
 	test_must_fail git merge branch 2>out &&
-	test_cmp out expect
+	test_i18ncmp out expect
 '
 
 cat >expect <<\EOF
 error: Your local changes to the following files would be overwritten by checkout:
 	rep/one
 	rep/two
-Please, commit your changes or stash them before you can switch branches.
+Please commit your changes or stash them before you can switch branches.
 Aborting
 EOF
 
@@ -87,21 +87,21 @@ test_expect_success 'cannot switch branches because of local changes' '
 	echo uno >rep/one &&
 	echo dos >rep/two &&
 	test_must_fail git checkout branch 2>out &&
-	test_cmp out expect
+	test_i18ncmp out expect
 '
 
 cat >expect <<\EOF
 error: Your local changes to the following files would be overwritten by checkout:
 	rep/one
 	rep/two
-Please, commit your changes or stash them before you can switch branches.
+Please commit your changes or stash them before you can switch branches.
 Aborting
 EOF
 
 test_expect_success 'not uptodate file porcelain checkout error' '
 	git add rep/one rep/two &&
 	test_must_fail git checkout branch 2>out &&
-	test_cmp out expect
+	test_i18ncmp out expect
 '
 
 cat >expect <<\EOF
@@ -132,7 +132,7 @@ test_expect_success 'not_uptodate_dir porcelain checkout error' '
 	>rep/untracked-file &&
 	>rep2/untracked-file &&
 	test_must_fail git checkout branch 2>out &&
-	test_cmp out ../expect
+	test_i18ncmp out ../expect
 '
 
 test_done
Previous: Vasco AlmeidaNext: Junio C Hamano
Message 15 of 23 in “i18n: index-pack: use plural string instead of normal one”
  1. 1/7 i18n: index-pack: use plural string instead of normal oneVasco Almeida, Apr 19, 2016
  2. 2/7 i18n: unpack-trees: mark strings for translationVasco Almeida, Apr 19, 2016
  3. 3/7 i18n: git-parse-remote.sh: mark strings for translationVasco Almeida, Apr 19, 2016
  4. 4/7 i18n: builtin/pull.c: mark placeholders for translationVasco Almeida, Apr 19, 2016
  5. 5/7 i18n: builtin/pull.c: split strings marked for translationVasco Almeida, Apr 19, 2016
  6. 6/7 i18n: builtin/rm.c: remove a comma ',' from stringVasco Almeida, Apr 19, 2016
  7. 7/7 i18n: builtin/branch.c: mark option for translationVasco Almeida, Apr 19, 2016
  8. Junio C HamanoApr 19, 2016
  9. Junio C HamanoApr 19, 2016
  10. 0/7 i18n miscellaneous updatesVasco Almeida, May 12, 2016
  11. 1/7 i18n: index-pack: use plural string instead of normal oneVasco Almeida, May 12, 2016
  12. 2/7 i18n: unpack-trees: mark strings for translationVasco Almeida, May 12, 2016
  13. Junio C HamanoMay 12, 2016
  14. i18n: unpack-trees: avoid substituting only a verb in sentencesVasco Almeida, May 12, 2016
  15. Junio C HamanoMay 12, 2016
  16. Junio C HamanoMay 12, 2016
  17. 3/7 i18n: git-parse-remote.sh: mark strings for translationVasco Almeida, May 12, 2016
  18. 4/7 i18n: builtin/pull.c: mark placeholders for translationVasco Almeida, May 12, 2016
  19. 5/7 i18n: builtin/pull.c: split strings marked for translationVasco Almeida, May 12, 2016
  20. 6/7 i18n: builtin/rm.c: remove a comma ',' from stringVasco Almeida, May 12, 2016
  21. Junio C HamanoMay 12, 2016
  22. 7/7 i18n: builtin/branch.c: mark option for translationVasco Almeida, May 12, 2016
  23. Junio C HamanoMay 12, 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.