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

[PATCH - v2] gitk: fix "Key bindings" message

From
Michele Ballabio <barra_cuda@katamail.com>
Date
Jan 9, 2008, 18:16 UTC
Message-ID
<200801091916.52680.barra_cuda@katamail.com>
In-Reply-To
<18308.2284.160506.432481@cargo.ozlabs.ibm.com>

Fix string substitution using 'string map'. Now the "Key bindings" menu is ready for translation.

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
---
On Wednesday 09 January 2008, Paul Mackerras wrote:
Show 6 quoted lines
> Michele Ballabio writes:
> 
> > -"] \
> > +" $M1T $M1T $M1T $M1T $M1T $M1T $M1T $M1T $M1T $M1T $M1T $M1T $M1T $M1T $M1T ] \
> 
> Ick.  Are you sure you have the right number of instances of $M1T? :)
Yes :^P. I was sure there was a better fix but didn't know where to look at.
> I'd prefer to use [string map].
This patch tries to do so. Is this correct?
> Actually, for translation, it would probably be better to bust up that
> help text into a series of shorter strings, maybe even one per line.
Or split this by "topic": "scrolling", "search", "fonts", "history"...
 gitk |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/gitk b/gitk
index 801a5a9..24796e1 100755
--- a/gitk
+++ b/gitk
@@ -1306,10 +1306,10 @@ proc keys {} {
     }
     toplevel $w
     wm title $w [mc "Gitk key bindings"]
-    message $w.m -text [mc "
+    message $w.m -text [ string map "M1T $M1T" [ mc "
 Gitk key bindings:
 
-<$M1T-Q>		Quit
+<M1T-Q>		Quit
 <Home>		Move to first commit
 <End>		Move to last commit
 <Up>, p, i	Move up one commit
@@ -1318,12 +1318,12 @@ Gitk key bindings:
 <Right>, x, l	Go forward in history list
 <PageUp>	Move up one page in commit list
 <PageDown>	Move down one page in commit list
-<$M1T-Home>	Scroll to top of commit list
-<$M1T-End>	Scroll to bottom of commit list
-<$M1T-Up>	Scroll commit list up one line
-<$M1T-Down>	Scroll commit list down one line
-<$M1T-PageUp>	Scroll commit list up one page
-<$M1T-PageDown>	Scroll commit list down one page
+<M1T-Home>	Scroll to top of commit list
+<M1T-End>	Scroll to bottom of commit list
+<M1T-Up>	Scroll commit list up one line
+<M1T-Down>	Scroll commit list down one line
+<M1T-PageUp>	Scroll commit list up one page
+<M1T-PageDown>	Scroll commit list down one page
 <Shift-Up>	Find backwards (upwards, later commits)
 <Shift-Down>	Find forwards (downwards, earlier commits)
 <Delete>, b	Scroll diff view up one page
@@ -1331,20 +1331,20 @@ Gitk key bindings:
 <Space>		Scroll diff view down one page
 u		Scroll diff view up 18 lines
 d		Scroll diff view down 18 lines
-<$M1T-F>		Find
-<$M1T-G>		Move to next find hit
+<M1T-F>		Find
+<M1T-G>		Move to next find hit
 <Return>	Move to next find hit
 /		Move to next find hit, or redo find
 ?		Move to previous find hit
 f		Scroll diff view to next file
-<$M1T-S>		Search for next hit in diff view
-<$M1T-R>		Search for previous hit in diff view
-<$M1T-KP+>	Increase font size
-<$M1T-plus>	Increase font size
-<$M1T-KP->	Decrease font size
-<$M1T-minus>	Decrease font size
+<M1T-S>		Search for next hit in diff view
+<M1T-R>		Search for previous hit in diff view
+<M1T-KP+>	Increase font size
+<M1T-plus>	Increase font size
+<M1T-KP->	Decrease font size
+<M1T-minus>	Decrease font size
 <F5>		Update
-"] \
+" ] ] \
 	    -justify left -bg white -border 2 -relief groove
     pack $w.m -side top -fill both -padx 2 -pady 2
     button $w.ok -text [mc "Close"] -command "destroy $w" -default active
-- 
1.5.3.5
Previous: Paul MackerrasNext: Paul Mackerras
Message 3 of 5 in “gitk: fix "Key bindings" message”
  1. gitk: fix "Key bindings" messageMichele Ballabio, Jan 8, 2008
  2. Paul MackerrasJan 8, 2008
  3. gitk: fix "Key bindings" messageMichele Ballabio, Jan 9, 2008
  4. Paul MackerrasJan 15, 2008
  5. gitk: fix "Key bindings" messageMichele Ballabio, Jan 15, 2008

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.