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