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

[PATCH 2/5] git-gui i18n: internationalize use of colon punctuation

From
Vasco Almeida <vascomalmeida@sapo.pt>
Date
May 8, 2016, 10:52 UTC
Message-ID
<1462704778-4722-2-git-send-email-vascomalmeida@sapo.pt>
In-Reply-To
<1462704778-4722-1-git-send-email-vascomalmeida@sapo.pt>

Internationalize use of colon punctuation ':' in options window, windows titles, database statistics window. Some languages might use a different style, for instance French uses "User Name :" (space before colon).

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 lib/branch_delete.tcl | 2 +-
 lib/database.tcl      | 2 +-
 lib/error.tcl         | 2 +-
 lib/option.tcl        | 8 ++++----
 4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/lib/branch_delete.tcl b/lib/branch_delete.tcl
index 867938e..9aef0c9 100644
--- a/lib/branch_delete.tcl
+++ b/lib/branch_delete.tcl
@@ -128,7 +128,7 @@ method _delete {} {
 		set b [lindex $i 0]
 		set o [lindex $i 1]
 		if {[catch {git branch -D $b} err]} {
-			append failed " - $b: $err\n"
+			append failed [mc " - %s:" $b] " $err\n"
 		}
 	}
 
diff --git a/lib/database.tcl b/lib/database.tcl
index 1f187ed..8bd4b8e 100644
--- a/lib/database.tcl
+++ b/lib/database.tcl
@@ -54,7 +54,7 @@ proc do_stats {} {
 			set value "$value[lindex $s 2]"
 		}
 
-		${NS}::label $w.stat.l_$name -text "$label:" -anchor w
+		${NS}::label $w.stat.l_$name -text [mc "%s:" $label] -anchor w
 		${NS}::label $w.stat.v_$name -text $value -anchor w
 		grid $w.stat.l_$name $w.stat.v_$name -sticky we -padx {0 5}
 	}
diff --git a/lib/error.tcl b/lib/error.tcl
index c0fa69a..9b7d229 100644
--- a/lib/error.tcl
+++ b/lib/error.tcl
@@ -113,7 +113,7 @@ proc hook_failed_popup {hook msg {is_fatal 1}} {
 
 	bind $w <Visibility> "grab $w; focus $w"
 	bind $w <Key-Return> "destroy $w"
-	wm title $w [strcat "[appname] ([reponame]): " [mc "error"]]
+	wm title $w [mc "%s (%s): error" [appname] [reponame]]
 	wm deiconify $w
 	tkwait window $w
 }
diff --git a/lib/option.tcl b/lib/option.tcl
index b5b6b2f..e43971b 100644
--- a/lib/option.tcl
+++ b/lib/option.tcl
@@ -179,7 +179,7 @@ proc do_options {} {
 			i-* {
 				regexp -- {-(\d+)\.\.(\d+)$} $type _junk min max
 				${NS}::frame $w.$f.$optid
-				${NS}::label $w.$f.$optid.l -text "$text:"
+				${NS}::label $w.$f.$optid.l -text [mc "%s:" $text]
 				pack $w.$f.$optid.l -side left -anchor w -fill x
 				tspinbox $w.$f.$optid.v \
 					-textvariable ${f}_config_new($name) \
@@ -194,7 +194,7 @@ proc do_options {} {
 			c -
 			t {
 				${NS}::frame $w.$f.$optid
-				${NS}::label $w.$f.$optid.l -text "$text:"
+				${NS}::label $w.$f.$optid.l -text [mc "%s:" $text]
 				${NS}::entry $w.$f.$optid.v \
 					-width 20 \
 					-textvariable ${f}_config_new($name)
@@ -217,7 +217,7 @@ proc do_options {} {
 			s {
 				set opts [eval [lindex $option 3]]
 				${NS}::frame $w.$f.$optid
-				${NS}::label $w.$f.$optid.l -text "$text:"
+				${NS}::label $w.$f.$optid.l -text [mc "%s:" $text]
 				if {$use_ttk} {
 					ttk::combobox $w.$f.$optid.v \
 						-textvariable ${f}_config_new($name) \
@@ -279,7 +279,7 @@ proc do_options {} {
 			[font configure $font -size]
 
 		${NS}::frame $w.global.$name
-		${NS}::label $w.global.$name.l -text "$text:"
+		${NS}::label $w.global.$name.l -text [mc "%s:" $text]
 		${NS}::button $w.global.$name.b \
 			-text [mc "Change Font"] \
 			-command [list \
-- 
2.7.3
Previous: Vasco AlmeidaNext: Vasco Almeida
Message 2 of 8 in “git-gui i18n: mark strings for translation”
  1. 1/5 git-gui i18n: mark strings for translationVasco Almeida, May 8, 2016
  2. 2/5 git-gui i18n: internationalize use of colon punctuationVasco Almeida, May 8, 2016
  3. 3/5 git-gui i18n: mark "usage:" strings for translationVasco Almeida, May 8, 2016
  4. 4/5 git-gui: fix incorrect use of Tcl append commandVasco Almeida, May 8, 2016
  5. Pat ThoytsOct 3, 2016
  6. 5/5 git-gui i18n: mark string in lib/error.tcl for translationVasco Almeida, May 8, 2016
  7. Pat ThoytsOct 3, 2016
  8. Vasco AlmeidaOct 3, 2016

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.