{"thread":{"id":"9143","subject":"[PATCH] git-gui-i18n: Fix translation of the context menu","startedAt":"2007-07-22T16:20:02Z","lastAt":"2007-07-23T09:58:22Z","messageCount":3,"participants":["Johannes Schindelin","Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"48149","messageId":"Pine.LNX.4.64.0707221719430.14781@racer.site","threadId":"9143","inReplyTo":null,"subject":"[PATCH] git-gui-i18n: Fix translation of the context menu","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-22T16:20:02Z","receivedAt":"2007-07-22T16:20:02Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThere is some funny code generation going on to make the context menu,\nand the messages for this have to be doubly quoted.\n\nNoticed by Harri Ilari Tapio Liusvaara\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n git-gui.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-gui.sh b/git-gui.sh\nindex 075a2b9..52170ee 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -2457,9 +2457,9 @@ bind_button3 $ui_diff \"\n \tset cursorX %x\n \tset cursorY %y\n \tif {\\$ui_index eq \\$current_diff_side} {\n-\t\t$ctxm entryconf $ui_diff_applyhunk -label [mc {Unstage Hunk From Commit}]\n+\t\t$ctxm entryconf $ui_diff_applyhunk -label \\\"[mc \"Unstage Hunk From Commit\"]\\\"\n \t} else {\n-\t\t$ctxm entryconf $ui_diff_applyhunk -label [mc {Stage Hunk For Commit}]\n+\t\t$ctxm entryconf $ui_diff_applyhunk -label \\\"[mc \"Stage Hunk For Commit\"]\\\"\n \t}\n \ttk_popup $ctxm %X %Y\n \"\n-- \n1.5.3.rc2.29.gc4640f\n"},{"id":"48254","messageId":"20070723035122.GB32566@spearce.org","threadId":"9143","inReplyTo":"Pine.LNX.4.64.0707221719430.14781@racer.site","subject":"Re: [PATCH] git-gui-i18n: Fix translation of the context menu","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-07-23T03:51:22Z","receivedAt":"2007-07-23T03:51:22Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> \n> There is some funny code generation going on to make the context menu,\n> and the messages for this have to be doubly quoted.\n> \n> Noticed by Harri Ilari Tapio Liusvaara\n> \n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  git-gui.sh |    4 ++--\n>  1 files changed, 2 insertions(+), 2 deletions(-)\n\nI'll try to rewrite this hunk as a procedure, to get rid of the\ndouble evaluation problem.  However...\n \n> diff --git a/git-gui.sh b/git-gui.sh\n> index 075a2b9..52170ee 100755\n> --- a/git-gui.sh\n> +++ b/git-gui.sh\n> @@ -2457,9 +2457,9 @@ bind_button3 $ui_diff \"\n>  \tset cursorX %x\n>  \tset cursorY %y\n>  \tif {\\$ui_index eq \\$current_diff_side} {\n> -\t\t$ctxm entryconf $ui_diff_applyhunk -label [mc {Unstage Hunk From Commit}]\n> +\t\t$ctxm entryconf $ui_diff_applyhunk -label \\\"[mc \"Unstage Hunk From Commit\"]\\\"\n\nThat's the wrong change to do here, as you are going to eval\nthe result of the translation.  If the translation had a Tcl\nspecial character (\\, $, [) in it then we'd actually execute that.\nInstead the [ should be escaped:\n\n> +\t\t$ctxm entryconf $ui_diff_applyhunk -label \\[mc \"Unstage Hunk From Commit\"\\]\n\nBut you aren't a Tcl programmer, so its OK.  ;-)\n\n-- \nShawn.\n"},{"id":"48291","messageId":"Pine.LNX.4.64.0707231057550.14781@racer.site","threadId":"9143","inReplyTo":"20070723035122.GB32566@spearce.org","subject":"Re: [PATCH] git-gui-i18n: Fix translation of the context menu","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-23T09:58:22Z","receivedAt":"2007-07-23T09:58:22Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 22 Jul 2007, Shawn O. Pearce wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n>\n> > diff --git a/git-gui.sh b/git-gui.sh\n> > index 075a2b9..52170ee 100755\n> > --- a/git-gui.sh\n> > +++ b/git-gui.sh\n> > @@ -2457,9 +2457,9 @@ bind_button3 $ui_diff \"\n> >  \tset cursorX %x\n> >  \tset cursorY %y\n> >  \tif {\\$ui_index eq \\$current_diff_side} {\n> > -\t\t$ctxm entryconf $ui_diff_applyhunk -label [mc {Unstage Hunk From Commit}]\n> > +\t\t$ctxm entryconf $ui_diff_applyhunk -label \\\"[mc \"Unstage Hunk From Commit\"]\\\"\n> \n> That's the wrong change to do here, as you are going to eval\n> the result of the translation.  If the translation had a Tcl\n> special character (\\, $, [) in it then we'd actually execute that.\n> Instead the [ should be escaped:\n> \n> > +\t\t$ctxm entryconf $ui_diff_applyhunk -label \\[mc \"Unstage Hunk From Commit\"\\]\n> \n> But you aren't a Tcl programmer, so its OK.  ;-)\n\nHeh.\n\nThanks,\nDscho\n"}]}