* [PATCH] git-gui-i18n: Fix translation of the context menu
@ 2007-07-22 16:20 Johannes Schindelin
2007-07-23 3:51 ` Shawn O. Pearce
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schindelin @ 2007-07-22 16:20 UTC (permalink / raw)
To: git
There is some funny code generation going on to make the context menu,
and the messages for this have to be doubly quoted.
Noticed by Harri Ilari Tapio Liusvaara
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
git-gui.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-gui.sh b/git-gui.sh
index 075a2b9..52170ee 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -2457,9 +2457,9 @@ bind_button3 $ui_diff "
set cursorX %x
set cursorY %y
if {\$ui_index eq \$current_diff_side} {
- $ctxm entryconf $ui_diff_applyhunk -label [mc {Unstage Hunk From Commit}]
+ $ctxm entryconf $ui_diff_applyhunk -label \"[mc "Unstage Hunk From Commit"]\"
} else {
- $ctxm entryconf $ui_diff_applyhunk -label [mc {Stage Hunk For Commit}]
+ $ctxm entryconf $ui_diff_applyhunk -label \"[mc "Stage Hunk For Commit"]\"
}
tk_popup $ctxm %X %Y
"
--
1.5.3.rc2.29.gc4640f
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] git-gui-i18n: Fix translation of the context menu
2007-07-22 16:20 [PATCH] git-gui-i18n: Fix translation of the context menu Johannes Schindelin
@ 2007-07-23 3:51 ` Shawn O. Pearce
2007-07-23 9:58 ` Johannes Schindelin
0 siblings, 1 reply; 3+ messages in thread
From: Shawn O. Pearce @ 2007-07-23 3:51 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>
> There is some funny code generation going on to make the context menu,
> and the messages for this have to be doubly quoted.
>
> Noticed by Harri Ilari Tapio Liusvaara
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> git-gui.sh | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
I'll try to rewrite this hunk as a procedure, to get rid of the
double evaluation problem. However...
> diff --git a/git-gui.sh b/git-gui.sh
> index 075a2b9..52170ee 100755
> --- a/git-gui.sh
> +++ b/git-gui.sh
> @@ -2457,9 +2457,9 @@ bind_button3 $ui_diff "
> set cursorX %x
> set cursorY %y
> if {\$ui_index eq \$current_diff_side} {
> - $ctxm entryconf $ui_diff_applyhunk -label [mc {Unstage Hunk From Commit}]
> + $ctxm entryconf $ui_diff_applyhunk -label \"[mc "Unstage Hunk From Commit"]\"
That's the wrong change to do here, as you are going to eval
the result of the translation. If the translation had a Tcl
special character (\, $, [) in it then we'd actually execute that.
Instead the [ should be escaped:
> + $ctxm entryconf $ui_diff_applyhunk -label \[mc "Unstage Hunk From Commit"\]
But you aren't a Tcl programmer, so its OK. ;-)
--
Shawn.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] git-gui-i18n: Fix translation of the context menu
2007-07-23 3:51 ` Shawn O. Pearce
@ 2007-07-23 9:58 ` Johannes Schindelin
0 siblings, 0 replies; 3+ messages in thread
From: Johannes Schindelin @ 2007-07-23 9:58 UTC (permalink / raw)
To: Shawn O. Pearce; +Cc: git
Hi,
On Sun, 22 Jul 2007, Shawn O. Pearce wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>
> > diff --git a/git-gui.sh b/git-gui.sh
> > index 075a2b9..52170ee 100755
> > --- a/git-gui.sh
> > +++ b/git-gui.sh
> > @@ -2457,9 +2457,9 @@ bind_button3 $ui_diff "
> > set cursorX %x
> > set cursorY %y
> > if {\$ui_index eq \$current_diff_side} {
> > - $ctxm entryconf $ui_diff_applyhunk -label [mc {Unstage Hunk From Commit}]
> > + $ctxm entryconf $ui_diff_applyhunk -label \"[mc "Unstage Hunk From Commit"]\"
>
> That's the wrong change to do here, as you are going to eval
> the result of the translation. If the translation had a Tcl
> special character (\, $, [) in it then we'd actually execute that.
> Instead the [ should be escaped:
>
> > + $ctxm entryconf $ui_diff_applyhunk -label \[mc "Unstage Hunk From Commit"\]
>
> But you aren't a Tcl programmer, so its OK. ;-)
Heh.
Thanks,
Dscho
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-23 9:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-22 16:20 [PATCH] git-gui-i18n: Fix translation of the context menu Johannes Schindelin
2007-07-23 3:51 ` Shawn O. Pearce
2007-07-23 9:58 ` Johannes Schindelin
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).