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

[PATCH] Fix translation of strings in foreach lists.

From
Christian Stimming <stimming@tuhh.de>
Date
Jul 24, 2007, 09:27 UTC
Message-ID
<20070724112701.ndpm5fxaocks804s@webmail.tu-harburg.de>
In-Reply-To
<1282.25717.qm@web38901.mail.mud.yahoo.com>
Fix translation of strings in foreach lists.
Signed-off-by: Christian Stimming <stimming@tuhh.de>
---
Quoting Brett Schwarz <brett_schwarz@yahoo.com>:
> I not sure if it's worth changing, but you don't necessarily need   
> those [append]'s in there.

Thanks for the info. It is basically up to Shawn to decide which style he likes more.

This patch is already necessary because I accidentally messed up the foreach argument lists. With this patch those will work again and will additionally be translated as well. (Unfortunately, I can't commit to git-gui-i18n ATM due to a http-only-firewall connection. Johannes...? Thanks.)

  lib/database.tcl |   16 ++++++++--------
  lib/option.tcl   |   26 +++++++++++++-------------
  2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/lib/database.tcl b/lib/database.tcl
index 8dda9af..118b1b2 100644
--- a/lib/database.tcl
+++ b/lib/database.tcl
@@ -40,16 +40,16 @@ proc do_stats {} {

  	frame $w.stat -borderwidth 1 -relief solid
  	foreach s {
-		{count           [mc "Number of loose objects"]}
-		{size            [mc "Disk space used by loose objects"] { KiB}}
-		{in-pack         [mc "Number of packed objects"]}
-		{packs           [mc "Number of packs"]}
-		{size-pack       [mc "Disk space used by packed objects"] { KiB}}
-		{prune-packable  [mc "Packed objects waiting for pruning"]}
-		{garbage         [mc "Garbage files"]}
+		{count           {mc "Number of loose objects"}}
+		{size            {mc "Disk space used by loose objects"} { KiB}}
+		{in-pack         {mc "Number of packed objects"}}
+		{packs           {mc "Number of packs"}}
+		{size-pack       {mc "Disk space used by packed objects"} { KiB}}
+		{prune-packable  {mc "Packed objects waiting for pruning"}}
+		{garbage         {mc "Garbage files"}}
  		} {
  		set name [lindex $s 0]
-		set label [lindex $s 1]
+		set label [eval [lindex $s 1]]
  		if {[catch {set value $stats($name)}]} continue
  		if {[llength $s] > 2} {
  			set value "$value[lindex $s 2]"
diff --git a/lib/option.tcl b/lib/option.tcl
index 6c4d7ae..8d9e09d 100644
--- a/lib/option.tcl
+++ b/lib/option.tcl
@@ -183,22 +183,22 @@ proc do_options {} {

  	set optid 0
  	foreach option {
-		{t user.name [mc "User Name"]}
-		{t user.email [mc "Email Address"]}
-
-		{b merge.summary [mc "Summarize Merge Commits"]}
-		{i-1..5 merge.verbosity [mc "Merge Verbosity"]}
-		{b merge.diffstat [mc "Show Diffstat After Merge"]}
-
-		{b gui.trustmtime  [mc "Trust File Modification Timestamps"]}
-		{b gui.pruneduringfetch [mc "Prune Tracking Branches During Fetch"]}
-		{b gui.matchtrackingbranch [mc "Match Tracking Branches"]}
-		{i-0..99 gui.diffcontext [mc "Number of Diff Context Lines"]}
-		{t gui.newbranchtemplate [mc "New Branch Name Template"]}
+		{t user.name {mc "User Name"}}
+		{t user.email {mc "Email Address"}}
+
+		{b merge.summary {mc "Summarize Merge Commits"}}
+		{i-1..5 merge.verbosity {mc "Merge Verbosity"}}
+		{b merge.diffstat {mc "Show Diffstat After Merge"}}
+
+		{b gui.trustmtime  {mc "Trust File Modification Timestamps"}}
+		{b gui.pruneduringfetch {mc "Prune Tracking Branches During Fetch"}}
+		{b gui.matchtrackingbranch {mc "Match Tracking Branches"}}
+		{i-0..99 gui.diffcontext {mc "Number of Diff Context Lines"}}
+		{t gui.newbranchtemplate {mc "New Branch Name Template"}}
  		} {
  		set type [lindex $option 0]
  		set name [lindex $option 1]
-		set text [lindex $option 2]
+		set text [eval [lindex $option 2]]
  		incr optid
  		foreach f {repo global} {
  			switch -glob -- $type {
-- 
1.5.3.rc2.12.gbc280
Previous: Brett SchwarzNext: Christian Stimming
Message 2 of 5 in “Re: [PATCH] Mark many more strings for i18n.”
  1. Brett SchwarzJul 23, 2007
  2. Fix translation of strings in foreach lists.Christian Stimming, Jul 24, 2007
  3. Mark more strings for i18n, including the status message list.Christian Stimming, Jul 24, 2007
  4. Shawn O. PearceJul 24, 2007
  5. Christian StimmingJul 24, 2007

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.