git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* eval_gettextln does not work correctly?
@ 2012-08-22 14:10 Nguyen Thai Ngoc Duy
  2012-08-22 14:17 ` Jonathan Nieder
  0 siblings, 1 reply; 4+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2012-08-22 14:10 UTC (permalink / raw)
  To: Git Mailing List, Jonathan Nieder,
	Ævar Arnfjörð Bjarmason

I was running git with preloadable_libintl.so to catch unmarked
strings and I saw this

domain "git"
msgid "The copy of the patch that failed is found in:\n"
"   /home/pclouds/w/git/t/trash
directory.t4254-am-corrupt/.git/rebase-apply/patch"
msgstr ""

which means git performed a lookup on that string. It is from git-am.sh:

eval_gettextln "The copy of the patch that failed is found in:
   $dotest/patch"

I suppose it should look up "...  $dotest/patch" instead (i.e. no
variable expansion). Something is wrong here? I have a few local
patches on top of master, but none of them touches gettext shell
functions.
-- 
Duy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: eval_gettextln does not work correctly?
  2012-08-22 14:10 eval_gettextln does not work correctly? Nguyen Thai Ngoc Duy
@ 2012-08-22 14:17 ` Jonathan Nieder
  2012-08-22 14:48   ` [PATCH] am: quote string for translation before passing to eval_gettextln Nguyễn Thái Ngọc Duy
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Nieder @ 2012-08-22 14:17 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy
  Cc: Git Mailing List, Ævar Arnfjörð Bjarmason

Nguyen Thai Ngoc Duy wrote:

> which means git performed a lookup on that string. It is from git-am.sh:
>
> eval_gettextln "The copy of the patch that failed is found in:
>    $dotest/patch"

Good catch.  It should use single-quotes.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] am: quote string for translation before passing to eval_gettextln
  2012-08-22 14:17 ` Jonathan Nieder
@ 2012-08-22 14:48   ` Nguyễn Thái Ngọc Duy
  2012-08-22 19:38     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2012-08-22 14:48 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Jonathan Niedier,
	Ævar Arnfjörð Bjarmason,
	Nguyễn Thái Ngọc Duy

If it's not quoted, the string is expanded before it gets looked up in
gettext database and obviously nothing is returned.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 On Wed, Aug 22, 2012 at 9:17 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
 > Nguyen Thai Ngoc Duy wrote:
 >
 >> which means git performed a lookup on that string. It is from git-am.sh:
 >>
 >> eval_gettextln "The copy of the patch that failed is found in:
 >>    $dotest/patch"
 >
 > Good catch.  It should use single-quotes.

 Yep. Verified. Also checked that no other places have this problem.
 xgettext probably detects this too. Without this patch it does not
 collect this string. With this patch, it does.

 git-am.sh | 4 ++--
 1 tập tin đã bị thay đổi, 2 được thêm vào(+), 2 bị xóa(-)

diff --git a/git-am.sh b/git-am.sh
index bd9620c..c682d34 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -855,8 +855,8 @@ did you forget to use 'git add'?"
 		eval_gettextln 'Patch failed at $msgnum $FIRSTLINE'
 		if test "$(git config --bool advice.amworkdir)" != false
 		then
-			eval_gettextln "The copy of the patch that failed is found in:
-   $dotest/patch"
+			eval_gettextln 'The copy of the patch that failed is found in:
+   $dotest/patch'
 		fi
 		stop_here_user_resolve $this
 	fi
-- 
1.7.12.rc2.18.g61b472e

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] am: quote string for translation before passing to eval_gettextln
  2012-08-22 14:48   ` [PATCH] am: quote string for translation before passing to eval_gettextln Nguyễn Thái Ngọc Duy
@ 2012-08-22 19:38     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2012-08-22 19:38 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy
  Cc: git, Jonathan Niedier, Ævar Arnfjörð Bjarmason

Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:

> If it's not quoted, the string is expanded before it gets looked up in
> gettext database and obviously nothing is returned.
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> ...
>  Yep. Verified. Also checked that no other places have this problem.
>  xgettext probably detects this too. Without this patch it does not
>  collect this string. With this patch, it does.

Will queue; thanks.

>
>  git-am.sh | 4 ++--
>  1 tập tin đã bị thay đổi, 2 được thêm vào(+), 2 bị xóa(-)
>
> diff --git a/git-am.sh b/git-am.sh
> index bd9620c..c682d34 100755
> --- a/git-am.sh
> +++ b/git-am.sh
> @@ -855,8 +855,8 @@ did you forget to use 'git add'?"
>  		eval_gettextln 'Patch failed at $msgnum $FIRSTLINE'
>  		if test "$(git config --bool advice.amworkdir)" != false
>  		then
> -			eval_gettextln "The copy of the patch that failed is found in:
> -   $dotest/patch"
> +			eval_gettextln 'The copy of the patch that failed is found in:
> +   $dotest/patch'
>  		fi
>  		stop_here_user_resolve $this
>  	fi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-22 19:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-22 14:10 eval_gettextln does not work correctly? Nguyen Thai Ngoc Duy
2012-08-22 14:17 ` Jonathan Nieder
2012-08-22 14:48   ` [PATCH] am: quote string for translation before passing to eval_gettextln Nguyễn Thái Ngọc Duy
2012-08-22 19:38     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).