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

Re: [PATCH v4 2/7] i18n: rebase: mark strings for translation

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jul 25, 2012, 04:21 UTC
Message-ID
<20120725042134.GA3055@burratino>
In-Reply-To
<915b2821410c2348817a469e7be05be497cf1d06.1343188013.git.worldhello.net@gmail.com>

(cc-ing Duy because of a mention of his nice GETTEXT_POISON tweak[*]) Hi,

Jiang Xin wrote:
> Mark strings in git-rebase.sh for translation. Jonathan offers a help
> for reorgnization of the resolvemsg variable in 'git-rebase.sh', since
> there is a likely message in git-am.sh, I update it in this commit for
> consistency. And so does to 't/t0201-gettext-fallbacks.sh'.

Ah. Looks like I tweaked the comma usage and sentence structure a little. Sorry, force of habit --- I shouldn't have.

> Some test scripts are affected by this update, and would fail if tested
> with GETTEXT_POISON switch turned on. Using i18n-specific test
> functions, such as test_i18ngrep, in the related test scripts will fix
> these issues.

If we're going to keep the changes together, here's how I would phrase the commit message:

	Mark messages in git-rebase.sh for translation.  While doing this
	it was noticed that the comma usage and sentence structure of the
	resolvemsg was not quite right, so correct that and its cousins in
	git-am.sh and t/t0201-gettext-fallbacks.sh at the same time.
	Some tests would start to fail with GETTEXT_POISON turned on after
	this update.  Use test_i18ncmp and test_i18ngrep where
	appropriate to mark strings that should only be checked in the C
	locale output to avoid such issues.
> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
> Reviewed-by: Stefano Lattarini <stefano.lattarini@gmail.com>
> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

I haven't tested or reviewed this patch in detail, so even though it looks good, I'd prefer it not to have my Reviewed-by. (See Documentation/SubmittingPatches: '"Reviewed-by:", unlike the other extra tags, can only be offered by the reviewer'.) If you'd like to credit my help, something like "With advice from Jonathan." would be fine.

[...]
Show 9 quoted lines
> --- a/t/t3406-rebase-message.sh
> +++ b/t/t3406-rebase-message.sh
> @@ -64,7 +64,7 @@ test_expect_success 'rebase -n overrides config rebase.stat config' '
>  
>  test_expect_success 'rebase --onto outputs the invalid ref' '
>  	test_must_fail git rebase --onto invalid-ref HEAD HEAD 2>err &&
> -	grep "invalid-ref" err
> +	test_i18ngrep "invalid-ref" err
>  '

Could we add a comment so others do not have to wonder what human-readable message prompts the test_i18ngrep here? e.g

	# "Does not point to a valid commit: invalid-ref"
	#
	# NEEDSWORK: This "grep" is fine in real non-C locales, but
	# GETTEXT_POISON poisons the refname along with the enclosing
	# error message.
	test_i18ngrep invalid-ref err

In the long run we may be able to turn this back to a "grep" again, since any reasonable translation will keep the $onto_name somewhere in the message. But changing it to test_i18ngrep for now is the right thing to do, until something like Duy's more sophisticated version of GETTEXT_POISON arrives. (<-- [*])

Thanks, Jonathan

Previous: Jiang XinNext: Jiang Xin
Message 13 of 15 in “i18n for git-am, git-rebase and git-merge”
  1. 0/7 i18n for git-am, git-rebase and git-mergeJiang Xin, Jul 25, 2012
  2. 1/7 i18n: New keywords for xgettext extraction from shJiang Xin, Jul 25, 2012
  3. 2/7 i18n: rebase: mark strings for translationJiang Xin, Jul 25, 2012
  4. 3/7 i18n: Rewrite gettext messages start with dashJiang Xin, Jul 25, 2012
  5. 4/7 Remove obsolete LONG_USAGE which breaks xgettextJiang Xin, Jul 25, 2012
  6. 5/7 i18n: am: mark more strings for translationJiang Xin, Jul 25, 2012
  7. 6/7 Remove dead code which contains bad gettext blockJiang Xin, Jul 25, 2012
  8. 7/7 i18n: merge-recursive: mark strings for translationJiang Xin, Jul 25, 2012
  9. Jonathan NiederJul 25, 2012
  10. Jonathan NiederJul 25, 2012
  11. Stefano LattariniJul 25, 2012
  12. Jiang XinJul 25, 2012
  13. Jonathan NiederJul 25, 2012
  14. Jiang XinJul 25, 2012
  15. Jonathan NiederJul 25, 2012

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.