[PATCH] Internationalization of git-gui

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is an initial patch of how internationalization (i18n) in git could be done, starting with the git-gui application (because I need that one in German to convince my workplace of switching to git).

Does this implementation look okay? If yes, I'd happily i18n'ize the rest of git-gui and provide a full German translation as well.

Thanks,

Christian Stimming
>From ea66070d95061e623cb5430fe88efea653e511e0 Mon Sep 17 00:00:00 2001
From: Christian Stimming <stimming@xxxxxxx>
Date: Thu, 19 Jul 2007 12:48:08 +0200
Subject: [PATCH] Initialize msgcat (gettext).

---
 git-gui/git-gui.sh |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 2077261..c56a3f1 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -108,6 +108,12 @@ if {$idx ne {}} {
 }
 unset -nocomplain oguirel idx fd
 
+## Internationalization (i18n) through gettext. See
+## http://www.gnu.org/software/gettext/manual/html_node/Tcl.html
+package require msgcat
+::msgcat::mcload [file join $oguilib msgs]
+proc _ {s} {return [::msgcat::mc $s]}
+
 ######################################################################
 ##
 ## read only globals
-- 
1.5.3.rc2.4.g726f9

>From 154d29786bdda205357595e22b3385d7cdb77453 Mon Sep 17 00:00:00 2001
From: Christian Stimming <stimming@xxxxxxx>
Date: Thu, 19 Jul 2007 12:49:09 +0200
Subject: [PATCH] Mark strings for translation

---
 git-gui/git-gui.sh |  154 ++++++++++++++++++++++++++--------------------------
 1 files changed, 77 insertions(+), 77 deletions(-)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index c56a3f1..45b7ef1 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -1618,18 +1618,18 @@ set ui_comm {}
 # -- Menu Bar
 #
 menu .mbar -tearoff 0
-.mbar add cascade -label Repository -menu .mbar.repository
-.mbar add cascade -label Edit -menu .mbar.edit
+.mbar add cascade -label [_ Repository] -menu .mbar.repository
+.mbar add cascade -label [_ Edit] -menu .mbar.edit
 if {[is_enabled branch]} {
-	.mbar add cascade -label Branch -menu .mbar.branch
+	.mbar add cascade -label [_ Branch] -menu .mbar.branch
 }
 if {[is_enabled multicommit] || [is_enabled singlecommit]} {
-	.mbar add cascade -label Commit -menu .mbar.commit
+	.mbar add cascade -label [_ Commit] -menu .mbar.commit
 }
 if {[is_enabled transport]} {
-	.mbar add cascade -label Merge -menu .mbar.merge
-	.mbar add cascade -label Fetch -menu .mbar.fetch
-	.mbar add cascade -label Push -menu .mbar.push
+	.mbar add cascade -label [_ Merge] -menu .mbar.merge
+	.mbar add cascade -label [_ Fetch] -menu .mbar.fetch
+	.mbar add cascade -label [_ Push] -menu .mbar.push
 }
 . configure -menu .mbar
 
@@ -1638,75 +1638,75 @@ if {[is_enabled transport]} {
 menu .mbar.repository
 
 .mbar.repository add command \
-	-label {Browse Current Branch} \
+	-label [_ {Browse Current Branch}] \
 	-command {browser::new $current_branch}
 trace add variable current_branch write ".mbar.repository entryconf [.mbar.repository index last] -label \"Browse \$current_branch\" ;#"
 .mbar.repository add separator
 
 .mbar.repository add command \
-	-label {Visualize Current Branch} \
+	-label [_ {Visualize Current Branch}]  \
 	-command {do_gitk $current_branch}
 trace add variable current_branch write ".mbar.repository entryconf [.mbar.repository index last] -label \"Visualize \$current_branch\" ;#"
 .mbar.repository add command \
-	-label {Visualize All Branches} \
+	-label [_ {Visualize All Branches}] \
 	-command {do_gitk --all}
 .mbar.repository add separator
 
 if {[is_enabled multicommit]} {
-	.mbar.repository add command -label {Database Statistics} \
+	.mbar.repository add command -label [_ {Database Statistics}] \
 		-command do_stats
 
-	.mbar.repository add command -label {Compress Database} \
+	.mbar.repository add command -label [_ {Compress Database}] \
 		-command do_gc
 
-	.mbar.repository add command -label {Verify Database} \
+	.mbar.repository add command -label [_ {Verify Database}] \
 		-command do_fsck_objects
 
 	.mbar.repository add separator
 
 	if {[is_Cygwin]} {
 		.mbar.repository add command \
-			-label {Create Desktop Icon} \
+			-label [_ {Create Desktop Icon}] \
 			-command do_cygwin_shortcut
 	} elseif {[is_Windows]} {
 		.mbar.repository add command \
-			-label {Create Desktop Icon} \
+			-label [_ {Create Desktop Icon}] \
 			-command do_windows_shortcut
 	} elseif {[is_MacOSX]} {
 		.mbar.repository add command \
-			-label {Create Desktop Icon} \
+			-label [_ {Create Desktop Icon}] \
 			-command do_macosx_app
 	}
 }
 
-.mbar.repository add command -label Quit \
+.mbar.repository add command -label [_ Quit] \
 	-command do_quit \
 	-accelerator $M1T-Q
 
 # -- Edit Menu
 #
 menu .mbar.edit
-.mbar.edit add command -label Undo \
+.mbar.edit add command -label [_ Undo] \
 	-command {catch {[focus] edit undo}} \
 	-accelerator $M1T-Z
-.mbar.edit add command -label Redo \
+.mbar.edit add command -label [_ Redo] \
 	-command {catch {[focus] edit redo}} \
 	-accelerator $M1T-Y
 .mbar.edit add separator
-.mbar.edit add command -label Cut \
+.mbar.edit add command -label [_ Cut] \
 	-command {catch {tk_textCut [focus]}} \
 	-accelerator $M1T-X
-.mbar.edit add command -label Copy \
+.mbar.edit add command -label [_ Copy] \
 	-command {catch {tk_textCopy [focus]}} \
 	-accelerator $M1T-C
-.mbar.edit add command -label Paste \
+.mbar.edit add command -label [_ Paste] \
 	-command {catch {tk_textPaste [focus]; [focus] see insert}} \
 	-accelerator $M1T-V
-.mbar.edit add command -label Delete \
+.mbar.edit add command -label [_ Delete] \
 	-command {catch {[focus] delete sel.first sel.last}} \
 	-accelerator Del
 .mbar.edit add separator
-.mbar.edit add command -label {Select All} \
+.mbar.edit add command -label [_ {Select All}] \
 	-command {catch {[focus] tag add sel 0.0 end}} \
 	-accelerator $M1T-A
 
@@ -1715,29 +1715,29 @@ menu .mbar.edit
 if {[is_enabled branch]} {
 	menu .mbar.branch
 
-	.mbar.branch add command -label {Create...} \
+	.mbar.branch add command -label [_ {Create...}] \
 		-command branch_create::dialog \
 		-accelerator $M1T-N
 	lappend disable_on_lock [list .mbar.branch entryconf \
 		[.mbar.branch index last] -state]
 
-	.mbar.branch add command -label {Checkout...} \
+	.mbar.branch add command -label [_ {Checkout...}] \
 		-command branch_checkout::dialog \
 		-accelerator $M1T-O
 	lappend disable_on_lock [list .mbar.branch entryconf \
 		[.mbar.branch index last] -state]
 
-	.mbar.branch add command -label {Rename...} \
+	.mbar.branch add command -label [_ {Rename...}] \
 		-command branch_rename::dialog
 	lappend disable_on_lock [list .mbar.branch entryconf \
 		[.mbar.branch index last] -state]
 
-	.mbar.branch add command -label {Delete...} \
+	.mbar.branch add command -label [_ {Delete...}] \
 		-command branch_delete::dialog
 	lappend disable_on_lock [list .mbar.branch entryconf \
 		[.mbar.branch index last] -state]
 
-	.mbar.branch add command -label {Reset...} \
+	.mbar.branch add command -label [_ {Reset...}] \
 		-command merge::reset_hard
 	lappend disable_on_lock [list .mbar.branch entryconf \
 		[.mbar.branch index last] -state]
@@ -1749,7 +1749,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
 	menu .mbar.commit
 
 	.mbar.commit add radiobutton \
-		-label {New Commit} \
+		-label [_ {New Commit}] \
 		-command do_select_commit_type \
 		-variable selected_commit_type \
 		-value new
@@ -1757,7 +1757,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
 	.mbar.commit add radiobutton \
-		-label {Amend Last Commit} \
+		-label [_ {Amend Last Commit}] \
 		-command do_select_commit_type \
 		-variable selected_commit_type \
 		-value amend
@@ -1766,40 +1766,40 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
 
 	.mbar.commit add separator
 
-	.mbar.commit add command -label Rescan \
+	.mbar.commit add command -label [_ Rescan] \
 		-command do_rescan \
 		-accelerator F5
 	lappend disable_on_lock \
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
-	.mbar.commit add command -label {Add To Commit} \
+	.mbar.commit add command -label [_ {Add To Commit}] \
 		-command do_add_selection
 	lappend disable_on_lock \
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
-	.mbar.commit add command -label {Add Existing To Commit} \
+	.mbar.commit add command -label [_ {Add Existing To Commit}] \
 		-command do_add_all \
 		-accelerator $M1T-I
 	lappend disable_on_lock \
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
-	.mbar.commit add command -label {Unstage From Commit} \
+	.mbar.commit add command -label [_ {Unstage From Commit}] \
 		-command do_unstage_selection
 	lappend disable_on_lock \
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
-	.mbar.commit add command -label {Revert Changes} \
+	.mbar.commit add command -label [_ {Revert Changes}] \
 		-command do_revert_selection
 	lappend disable_on_lock \
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
 	.mbar.commit add separator
 
-	.mbar.commit add command -label {Sign Off} \
+	.mbar.commit add command -label [_ {Sign Off}] \
 		-command do_signoff \
 		-accelerator $M1T-S
 
-	.mbar.commit add command -label Commit \
+	.mbar.commit add command -label [_ Commit] \
 		-command do_commit \
 		-accelerator $M1T-Return
 	lappend disable_on_lock \
@@ -1810,11 +1810,11 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
 #
 if {[is_enabled branch]} {
 	menu .mbar.merge
-	.mbar.merge add command -label {Local Merge...} \
+	.mbar.merge add command -label [_ {Local Merge...}] \
 		-command merge::dialog
 	lappend disable_on_lock \
 		[list .mbar.merge entryconf [.mbar.merge index last] -state]
-	.mbar.merge add command -label {Abort Merge...} \
+	.mbar.merge add command -label [_ {Abort Merge...}] \
 		-command merge::reset_hard
 	lappend disable_on_lock \
 		[list .mbar.merge entryconf [.mbar.merge index last] -state]
@@ -1827,28 +1827,28 @@ if {[is_enabled transport]} {
 	menu .mbar.fetch
 
 	menu .mbar.push
-	.mbar.push add command -label {Push...} \
+	.mbar.push add command -label [_ {Push...}] \
 		-command do_push_anywhere \
 		-accelerator $M1T-P
-	.mbar.push add command -label {Delete...} \
+	.mbar.push add command -label [_ {Delete...}] \
 		-command remote_branch_delete::dialog
 }
 
 if {[is_MacOSX]} {
 	# -- Apple Menu (Mac OS X only)
 	#
-	.mbar add cascade -label Apple -menu .mbar.apple
+	.mbar add cascade -label [_ Apple] -menu .mbar.apple
 	menu .mbar.apple
 
-	.mbar.apple add command -label "About [appname]" \
+	.mbar.apple add command -label [format [_ "About %s"] [appname]] \
 		-command do_about
-	.mbar.apple add command -label "Options..." \
+	.mbar.apple add command -label [_ "Options..."] \
 		-command do_options
 } else {
 	# -- Edit Menu
 	#
 	.mbar.edit add separator
-	.mbar.edit add command -label {Options...} \
+	.mbar.edit add command -label [_ {Options...}] \
 		-command do_options
 
 	# -- Tools Menu
@@ -1870,9 +1870,9 @@ if {[is_MacOSX]} {
 			rescan ui_ready
 		}
 	}
-	.mbar add cascade -label Tools -menu .mbar.tools
+	.mbar add cascade -label [_ Tools] -menu .mbar.tools
 	menu .mbar.tools
-	.mbar.tools add command -label "Migrate" \
+	.mbar.tools add command -label [_ "Migrate"] \
 		-command do_miga
 	lappend disable_on_lock \
 		[list .mbar.tools entryconf [.mbar.tools index last] -state]
@@ -1881,11 +1881,11 @@ if {[is_MacOSX]} {
 
 # -- Help Menu
 #
-.mbar add cascade -label Help -menu .mbar.help
+.mbar add cascade -label [_ Help] -menu .mbar.help
 menu .mbar.help
 
 if {![is_MacOSX]} {
-	.mbar.help add command -label "About [appname]" \
+	.mbar.help add command -label [format [_ "About %s"] [appname]] \
 		-command do_about
 }
 
@@ -1922,7 +1922,7 @@ if {[file isfile $doc_path]} {
 }
 
 if {$browser ne {}} {
-	.mbar.help add command -label {Online Documentation} \
+	.mbar.help add command -label [_ {Online Documentation}] \
 		-command [list exec $browser $doc_url &]
 }
 unset browser doc_path doc_url
@@ -2167,12 +2167,12 @@ label $ui_coml \
 proc trace_commit_type {varname args} {
 	global ui_coml commit_type
 	switch -glob -- $commit_type {
-	initial       {set txt {Initial Commit Message:}}
-	amend         {set txt {Amended Commit Message:}}
-	amend-initial {set txt {Amended Initial Commit Message:}}
-	amend-merge   {set txt {Amended Merge Commit Message:}}
-	merge         {set txt {Merge Commit Message:}}
-	*             {set txt {Commit Message:}}
+	initial       {set txt [_ {Initial Commit Message:}]}
+	amend         {set txt [_ {Amended Commit Message:}]}
+	amend-initial {set txt [_ {Amended Initial Commit Message:}]}
+	amend-merge   {set txt [_ {Amended Merge Commit Message:}]}
+	merge         {set txt [_ {Merge Commit Message:}]}
+	*             {set txt [_ {Commit Message:}]}
 	}
 	$ui_coml conf -text $txt
 }
@@ -2201,23 +2201,23 @@ pack .vpane.lower.commarea.buffer -side left -fill y
 set ctxm .vpane.lower.commarea.buffer.ctxm
 menu $ctxm -tearoff 0
 $ctxm add command \
-	-label {Cut} \
+	-label [_ {Cut}] \
 	-command {tk_textCut $ui_comm}
 $ctxm add command \
-	-label {Copy} \
+	-label [_ {Copy}] \
 	-command {tk_textCopy $ui_comm}
 $ctxm add command \
-	-label {Paste} \
+	-label [_ {Paste}] \
 	-command {tk_textPaste $ui_comm}
 $ctxm add command \
-	-label {Delete} \
+	-label [_ {Delete}] \
 	-command {$ui_comm delete sel.first sel.last}
 $ctxm add separator
 $ctxm add command \
-	-label {Select All} \
+	-label [_ {Select All}] \
 	-command {focus $ui_comm;$ui_comm tag add sel 0.0 end}
 $ctxm add command \
-	-label {Copy All} \
+	-label [_ {Copy All}] \
 	-command {
 		$ui_comm tag add sel 0.0 end
 		tk_textCopy $ui_comm
@@ -2225,7 +2225,7 @@ $ctxm add command \
 	}
 $ctxm add separator
 $ctxm add command \
-	-label {Sign Off} \
+	-label [_ {Sign Off}] \
 	-command do_signoff
 bind_button3 $ui_comm "tk_popup $ctxm %X %Y"
 
@@ -2275,7 +2275,7 @@ pack .vpane.lower.diff.header.path -fill x
 set ctxm .vpane.lower.diff.header.ctxm
 menu $ctxm -tearoff 0
 $ctxm add command \
-	-label {Copy} \
+	-label [_ {Copy}] \
 	-command {
 		clipboard clear
 		clipboard append \
@@ -2343,19 +2343,19 @@ $ui_diff tag raise sel
 set ctxm .vpane.lower.diff.body.ctxm
 menu $ctxm -tearoff 0
 $ctxm add command \
-	-label {Refresh} \
+	-label [_ {Refresh}] \
 	-command reshow_diff
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add command \
-	-label {Copy} \
+	-label [_ {Copy}] \
 	-command {tk_textCopy $ui_diff}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add command \
-	-label {Select All} \
+	-label [_ {Select All}] \
 	-command {focus $ui_diff;$ui_diff tag add sel 0.0 end}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add command \
-	-label {Copy All} \
+	-label [_ {Copy All}] \
 	-command {
 		$ui_diff tag add sel 0.0 end
 		tk_textCopy $ui_diff
@@ -2364,44 +2364,44 @@ $ctxm add command \
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add separator
 $ctxm add command \
-	-label {Apply/Reverse Hunk} \
+	-label [_ {Apply/Reverse Hunk}] \
 	-command {apply_hunk $cursorX $cursorY}
 set ui_diff_applyhunk [$ctxm index last]
 lappend diff_actions [list $ctxm entryconf $ui_diff_applyhunk -state]
 $ctxm add separator
 $ctxm add command \
-	-label {Decrease Font Size} \
+	-label [_ {Decrease Font Size}] \
 	-command {incr_font_size font_diff -1}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add command \
-	-label {Increase Font Size} \
+	-label [_ {Increase Font Size}] \
 	-command {incr_font_size font_diff 1}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add separator
 $ctxm add command \
-	-label {Show Less Context} \
+	-label [_ {Show Less Context}] \
 	-command {if {$repo_config(gui.diffcontext) >= 1} {
 		incr repo_config(gui.diffcontext) -1
 		reshow_diff
 	}}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add command \
-	-label {Show More Context} \
+	-label [_ {Show More Context}] \
 	-command {if {$repo_config(gui.diffcontext) < 99} {
 		incr repo_config(gui.diffcontext)
 		reshow_diff
 	}}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add separator
-$ctxm add command -label {Options...} \
+$ctxm add command -label [_ {Options...}] \
 	-command do_options
 bind_button3 $ui_diff "
 	set cursorX %x
 	set cursorY %y
 	if {\$ui_index eq \$current_diff_side} {
-		$ctxm entryconf $ui_diff_applyhunk -label {Unstage Hunk From Commit}
+		$ctxm entryconf $ui_diff_applyhunk -label [_ {Unstage Hunk From Commit}]
 	} else {
-		$ctxm entryconf $ui_diff_applyhunk -label {Stage Hunk For Commit}
+		$ctxm entryconf $ui_diff_applyhunk -label [_ {Stage Hunk For Commit}]
 	}
 	tk_popup $ctxm %X %Y
 "
-- 
1.5.3.rc2.4.g726f9

>From 3ff00ecdabb82448b95ad3b9e738441236c0eb11 Mon Sep 17 00:00:00 2001
From: Christian Stimming <stimming@xxxxxxx>
Date: Thu, 19 Jul 2007 12:49:11 +0200
Subject: [PATCH] Enclose strings in quotes, not in braces, so that xgettext finds them

---
 git-gui/git-gui.sh |  104 ++++++++++++++++++++++++++--------------------------
 1 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 45b7ef1..5eef35d 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -1638,43 +1638,43 @@ if {[is_enabled transport]} {
 menu .mbar.repository
 
 .mbar.repository add command \
-	-label [_ {Browse Current Branch}] \
+	-label [_ "Browse Current Branch"] \
 	-command {browser::new $current_branch}
 trace add variable current_branch write ".mbar.repository entryconf [.mbar.repository index last] -label \"Browse \$current_branch\" ;#"
 .mbar.repository add separator
 
 .mbar.repository add command \
-	-label [_ {Visualize Current Branch}]  \
+	-label [_ "Visualize Current Branch"]  \
 	-command {do_gitk $current_branch}
 trace add variable current_branch write ".mbar.repository entryconf [.mbar.repository index last] -label \"Visualize \$current_branch\" ;#"
 .mbar.repository add command \
-	-label [_ {Visualize All Branches}] \
+	-label [_ "Visualize All Branches"] \
 	-command {do_gitk --all}
 .mbar.repository add separator
 
 if {[is_enabled multicommit]} {
-	.mbar.repository add command -label [_ {Database Statistics}] \
+	.mbar.repository add command -label [_ "Database Statistics"] \
 		-command do_stats
 
-	.mbar.repository add command -label [_ {Compress Database}] \
+	.mbar.repository add command -label [_ "Compress Database"] \
 		-command do_gc
 
-	.mbar.repository add command -label [_ {Verify Database}] \
+	.mbar.repository add command -label [_ "Verify Database"] \
 		-command do_fsck_objects
 
 	.mbar.repository add separator
 
 	if {[is_Cygwin]} {
 		.mbar.repository add command \
-			-label [_ {Create Desktop Icon}] \
+			-label [_ "Create Desktop Icon"] \
 			-command do_cygwin_shortcut
 	} elseif {[is_Windows]} {
 		.mbar.repository add command \
-			-label [_ {Create Desktop Icon}] \
+			-label [_ "Create Desktop Icon"] \
 			-command do_windows_shortcut
 	} elseif {[is_MacOSX]} {
 		.mbar.repository add command \
-			-label [_ {Create Desktop Icon}] \
+			-label [_ "Create Desktop Icon"] \
 			-command do_macosx_app
 	}
 }
@@ -1706,7 +1706,7 @@ menu .mbar.edit
 	-command {catch {[focus] delete sel.first sel.last}} \
 	-accelerator Del
 .mbar.edit add separator
-.mbar.edit add command -label [_ {Select All}] \
+.mbar.edit add command -label [_ "Select All"] \
 	-command {catch {[focus] tag add sel 0.0 end}} \
 	-accelerator $M1T-A
 
@@ -1715,29 +1715,29 @@ menu .mbar.edit
 if {[is_enabled branch]} {
 	menu .mbar.branch
 
-	.mbar.branch add command -label [_ {Create...}] \
+	.mbar.branch add command -label [_ "Create..."] \
 		-command branch_create::dialog \
 		-accelerator $M1T-N
 	lappend disable_on_lock [list .mbar.branch entryconf \
 		[.mbar.branch index last] -state]
 
-	.mbar.branch add command -label [_ {Checkout...}] \
+	.mbar.branch add command -label [_ "Checkout..."] \
 		-command branch_checkout::dialog \
 		-accelerator $M1T-O
 	lappend disable_on_lock [list .mbar.branch entryconf \
 		[.mbar.branch index last] -state]
 
-	.mbar.branch add command -label [_ {Rename...}] \
+	.mbar.branch add command -label [_ "Rename..."] \
 		-command branch_rename::dialog
 	lappend disable_on_lock [list .mbar.branch entryconf \
 		[.mbar.branch index last] -state]
 
-	.mbar.branch add command -label [_ {Delete...}] \
+	.mbar.branch add command -label [_ "Delete..."] \
 		-command branch_delete::dialog
 	lappend disable_on_lock [list .mbar.branch entryconf \
 		[.mbar.branch index last] -state]
 
-	.mbar.branch add command -label [_ {Reset...}] \
+	.mbar.branch add command -label [_ "Reset..."] \
 		-command merge::reset_hard
 	lappend disable_on_lock [list .mbar.branch entryconf \
 		[.mbar.branch index last] -state]
@@ -1749,7 +1749,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
 	menu .mbar.commit
 
 	.mbar.commit add radiobutton \
-		-label [_ {New Commit}] \
+		-label [_ "New Commit"] \
 		-command do_select_commit_type \
 		-variable selected_commit_type \
 		-value new
@@ -1757,7 +1757,7 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
 	.mbar.commit add radiobutton \
-		-label [_ {Amend Last Commit}] \
+		-label [_ "Amend Last Commit"] \
 		-command do_select_commit_type \
 		-variable selected_commit_type \
 		-value amend
@@ -1772,30 +1772,30 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
 	lappend disable_on_lock \
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
-	.mbar.commit add command -label [_ {Add To Commit}] \
+	.mbar.commit add command -label [_ "Add To Commit"] \
 		-command do_add_selection
 	lappend disable_on_lock \
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
-	.mbar.commit add command -label [_ {Add Existing To Commit}] \
+	.mbar.commit add command -label [_ "Add Existing To Commit"] \
 		-command do_add_all \
 		-accelerator $M1T-I
 	lappend disable_on_lock \
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
-	.mbar.commit add command -label [_ {Unstage From Commit}] \
+	.mbar.commit add command -label [_ "Unstage From Commit"] \
 		-command do_unstage_selection
 	lappend disable_on_lock \
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
-	.mbar.commit add command -label [_ {Revert Changes}] \
+	.mbar.commit add command -label [_ "Revert Changes"] \
 		-command do_revert_selection
 	lappend disable_on_lock \
 		[list .mbar.commit entryconf [.mbar.commit index last] -state]
 
 	.mbar.commit add separator
 
-	.mbar.commit add command -label [_ {Sign Off}] \
+	.mbar.commit add command -label [_ "Sign Off"] \
 		-command do_signoff \
 		-accelerator $M1T-S
 
@@ -1810,11 +1810,11 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
 #
 if {[is_enabled branch]} {
 	menu .mbar.merge
-	.mbar.merge add command -label [_ {Local Merge...}] \
+	.mbar.merge add command -label [_ "Local Merge..."] \
 		-command merge::dialog
 	lappend disable_on_lock \
 		[list .mbar.merge entryconf [.mbar.merge index last] -state]
-	.mbar.merge add command -label [_ {Abort Merge...}] \
+	.mbar.merge add command -label [_ "Abort Merge..."] \
 		-command merge::reset_hard
 	lappend disable_on_lock \
 		[list .mbar.merge entryconf [.mbar.merge index last] -state]
@@ -1827,10 +1827,10 @@ if {[is_enabled transport]} {
 	menu .mbar.fetch
 
 	menu .mbar.push
-	.mbar.push add command -label [_ {Push...}] \
+	.mbar.push add command -label [_ "Push..."] \
 		-command do_push_anywhere \
 		-accelerator $M1T-P
-	.mbar.push add command -label [_ {Delete...}] \
+	.mbar.push add command -label [_ "Delete..."] \
 		-command remote_branch_delete::dialog
 }
 
@@ -1848,7 +1848,7 @@ if {[is_MacOSX]} {
 	# -- Edit Menu
 	#
 	.mbar.edit add separator
-	.mbar.edit add command -label [_ {Options...}] \
+	.mbar.edit add command -label [_ "Options..."] \
 		-command do_options
 
 	# -- Tools Menu
@@ -1922,7 +1922,7 @@ if {[file isfile $doc_path]} {
 }
 
 if {$browser ne {}} {
-	.mbar.help add command -label [_ {Online Documentation}] \
+	.mbar.help add command -label [_ "Online Documentation"] \
 		-command [list exec $browser $doc_url &]
 }
 unset browser doc_path doc_url
@@ -2167,12 +2167,12 @@ label $ui_coml \
 proc trace_commit_type {varname args} {
 	global ui_coml commit_type
 	switch -glob -- $commit_type {
-	initial       {set txt [_ {Initial Commit Message:}]}
-	amend         {set txt [_ {Amended Commit Message:}]}
-	amend-initial {set txt [_ {Amended Initial Commit Message:}]}
-	amend-merge   {set txt [_ {Amended Merge Commit Message:}]}
-	merge         {set txt [_ {Merge Commit Message:}]}
-	*             {set txt [_ {Commit Message:}]}
+	initial       {set txt [_ "Initial Commit Message:"]}
+	amend         {set txt [_ "Amended Commit Message:"]}
+	amend-initial {set txt [_ "Amended Initial Commit Message:"]}
+	amend-merge   {set txt [_ "Amended Merge Commit Message:"]}
+	merge         {set txt [_ "Merge Commit Message:"]}
+	*             {set txt [_ "Commit Message:"]}
 	}
 	$ui_coml conf -text $txt
 }
@@ -2201,23 +2201,23 @@ pack .vpane.lower.commarea.buffer -side left -fill y
 set ctxm .vpane.lower.commarea.buffer.ctxm
 menu $ctxm -tearoff 0
 $ctxm add command \
-	-label [_ {Cut}] \
+	-label [_ Cut] \
 	-command {tk_textCut $ui_comm}
 $ctxm add command \
-	-label [_ {Copy}] \
+	-label [_ Copy] \
 	-command {tk_textCopy $ui_comm}
 $ctxm add command \
-	-label [_ {Paste}] \
+	-label [_ Paste] \
 	-command {tk_textPaste $ui_comm}
 $ctxm add command \
-	-label [_ {Delete}] \
+	-label [_ Delete] \
 	-command {$ui_comm delete sel.first sel.last}
 $ctxm add separator
 $ctxm add command \
-	-label [_ {Select All}] \
+	-label [_ "Select All"] \
 	-command {focus $ui_comm;$ui_comm tag add sel 0.0 end}
 $ctxm add command \
-	-label [_ {Copy All}] \
+	-label [_ "Copy All"] \
 	-command {
 		$ui_comm tag add sel 0.0 end
 		tk_textCopy $ui_comm
@@ -2225,7 +2225,7 @@ $ctxm add command \
 	}
 $ctxm add separator
 $ctxm add command \
-	-label [_ {Sign Off}] \
+	-label [_ "Sign Off"] \
 	-command do_signoff
 bind_button3 $ui_comm "tk_popup $ctxm %X %Y"
 
@@ -2275,7 +2275,7 @@ pack .vpane.lower.diff.header.path -fill x
 set ctxm .vpane.lower.diff.header.ctxm
 menu $ctxm -tearoff 0
 $ctxm add command \
-	-label [_ {Copy}] \
+	-label [_ Copy] \
 	-command {
 		clipboard clear
 		clipboard append \
@@ -2343,19 +2343,19 @@ $ui_diff tag raise sel
 set ctxm .vpane.lower.diff.body.ctxm
 menu $ctxm -tearoff 0
 $ctxm add command \
-	-label [_ {Refresh}] \
+	-label [_ Refresh] \
 	-command reshow_diff
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add command \
-	-label [_ {Copy}] \
+	-label [_ Copy] \
 	-command {tk_textCopy $ui_diff}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add command \
-	-label [_ {Select All}] \
+	-label [_ "Select All"] \
 	-command {focus $ui_diff;$ui_diff tag add sel 0.0 end}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add command \
-	-label [_ {Copy All}] \
+	-label [_ "Copy All"] \
 	-command {
 		$ui_diff tag add sel 0.0 end
 		tk_textCopy $ui_diff
@@ -2364,36 +2364,36 @@ $ctxm add command \
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add separator
 $ctxm add command \
-	-label [_ {Apply/Reverse Hunk}] \
+	-label [_ "Apply/Reverse Hunk"] \
 	-command {apply_hunk $cursorX $cursorY}
 set ui_diff_applyhunk [$ctxm index last]
 lappend diff_actions [list $ctxm entryconf $ui_diff_applyhunk -state]
 $ctxm add separator
 $ctxm add command \
-	-label [_ {Decrease Font Size}] \
+	-label [_ "Decrease Font Size"] \
 	-command {incr_font_size font_diff -1}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add command \
-	-label [_ {Increase Font Size}] \
+	-label [_ "Increase Font Size"] \
 	-command {incr_font_size font_diff 1}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add separator
 $ctxm add command \
-	-label [_ {Show Less Context}] \
+	-label [_ "Show Less Context"] \
 	-command {if {$repo_config(gui.diffcontext) >= 1} {
 		incr repo_config(gui.diffcontext) -1
 		reshow_diff
 	}}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add command \
-	-label [_ {Show More Context}] \
+	-label [_ "Show More Context"] \
 	-command {if {$repo_config(gui.diffcontext) < 99} {
 		incr repo_config(gui.diffcontext)
 		reshow_diff
 	}}
 lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
 $ctxm add separator
-$ctxm add command -label [_ {Options...}] \
+$ctxm add command -label [_ "Options..."] \
 	-command do_options
 bind_button3 $ui_diff "
 	set cursorX %x
-- 
1.5.3.rc2.4.g726f9

>From 9b7ef0f5d5627e65e5ab354cf99c8939770416d9 Mon Sep 17 00:00:00 2001
From: Christian Stimming <stimming@xxxxxxx>
Date: Thu, 19 Jul 2007 12:50:19 +0200
Subject: [PATCH] Initial German translation for testing of i18n.

---
 git-gui/po/de.po |  249 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 249 insertions(+), 0 deletions(-)
 create mode 100644 git-gui/po/de.po

diff --git a/git-gui/po/de.po b/git-gui/po/de.po
new file mode 100644
index 0000000..7a74329
--- /dev/null
+++ b/git-gui/po/de.po
@@ -0,0 +1,249 @@
+# Translation of git-gui to German.
+# Copyright (C) 2007 Linux Thorvalds
+# This file is distributed under the same license as the git package.
+# Christian Stimming <stimming@xxxxxxx>, 2007
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: git-gui\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2007-07-18 18:27+0200\n"
+"PO-Revision-Date: 2007-07-19 11:45+0200\n"
+"Last-Translator: Christian Stimming <stimming@xxxxxxx>\n"
+"Language-Team: German\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: git-gui.sh:1622
+msgid "Repository"
+msgstr ""
+
+#: git-gui.sh:1623
+msgid "Edit"
+msgstr "Bearbeiten"
+
+#: git-gui.sh:1625
+msgid "Branch"
+msgstr ""
+
+#: git-gui.sh:1628 git-gui.sh:1803
+msgid "Commit"
+msgstr ""
+
+#: git-gui.sh:1631
+msgid "Merge"
+msgstr ""
+
+#: git-gui.sh:1632
+msgid "Fetch"
+msgstr ""
+
+#: git-gui.sh:1633
+msgid "Push"
+msgstr ""
+
+#: git-gui.sh:1642
+msgid "Browse Current Branch"
+msgstr ""
+
+#: git-gui.sh:1648
+msgid "Visualize Current Branch"
+msgstr ""
+
+#: git-gui.sh:1652
+msgid "Visualize All Branches"
+msgstr ""
+
+#: git-gui.sh:1657
+msgid "Database Statistics"
+msgstr ""
+
+#: git-gui.sh:1660
+msgid "Compress Database"
+msgstr ""
+
+#: git-gui.sh:1663
+msgid "Verify Database"
+msgstr ""
+
+#: git-gui.sh:1670 git-gui.sh:1674 git-gui.sh:1678
+msgid "Create Desktop Icon"
+msgstr ""
+
+#: git-gui.sh:1683
+msgid "Quit"
+msgstr "Beenden"
+
+#: git-gui.sh:1690
+msgid "Undo"
+msgstr "Rückgängig"
+
+#: git-gui.sh:1693
+msgid "Redo"
+msgstr ""
+
+#: git-gui.sh:1697 git-gui.sh:2205
+msgid "Cut"
+msgstr "Ausschneiden"
+
+#: git-gui.sh:1700 git-gui.sh:2208 git-gui.sh:2279 git-gui.sh:2351
+msgid "Copy"
+msgstr "Kopieren"
+
+#: git-gui.sh:1703 git-gui.sh:2211
+msgid "Paste"
+msgstr "Einfügen"
+
+#: git-gui.sh:1706 git-gui.sh:2214
+msgid "Delete"
+msgstr "Löschen"
+
+#: git-gui.sh:1710 git-gui.sh:2218 git-gui.sh:2355
+msgid "Select All"
+msgstr ""
+
+#: git-gui.sh:1719
+msgid "Create..."
+msgstr ""
+
+#: git-gui.sh:1725
+msgid "Checkout..."
+msgstr ""
+
+#: git-gui.sh:1731
+msgid "Rename..."
+msgstr ""
+
+#: git-gui.sh:1736 git-gui.sh:1834
+msgid "Delete..."
+msgstr "Löschen..."
+
+#: git-gui.sh:1741
+msgid "Reset..."
+msgstr ""
+
+#: git-gui.sh:1753
+msgid "New Commit"
+msgstr ""
+
+#: git-gui.sh:1761
+msgid "Amend Last Commit"
+msgstr ""
+
+#: git-gui.sh:1770
+msgid "Rescan"
+msgstr "Neu laden"
+
+#: git-gui.sh:1776
+msgid "Add To Commit"
+msgstr ""
+
+#: git-gui.sh:1781
+msgid "Add Existing To Commit"
+msgstr ""
+
+#: git-gui.sh:1787
+msgid "Unstage From Commit"
+msgstr ""
+
+#: git-gui.sh:1792
+msgid "Revert Changes"
+msgstr ""
+
+#: git-gui.sh:1799 git-gui.sh:2229
+msgid "Sign Off"
+msgstr ""
+
+#: git-gui.sh:1814
+msgid "Local Merge..."
+msgstr ""
+
+#: git-gui.sh:1818
+msgid "Abort Merge..."
+msgstr ""
+
+#: git-gui.sh:1831
+msgid "Push..."
+msgstr ""
+
+#: git-gui.sh:1841
+msgid "Apple"
+msgstr "Apple"
+
+#: git-gui.sh:1844 git-gui.sh:1889
+#, tcl-format
+msgid "About %s"
+msgstr ""
+
+#: git-gui.sh:1846 git-gui.sh:1852 git-gui.sh:2397
+msgid "Options..."
+msgstr ""
+
+#: git-gui.sh:1874
+msgid "Tools"
+msgstr "Werkzeuge"
+
+#: git-gui.sh:1876
+msgid "Migrate"
+msgstr ""
+
+#: git-gui.sh:1885
+msgid "Help"
+msgstr "Hilfe"
+
+#: git-gui.sh:1926
+msgid "Online Documentation"
+msgstr ""
+
+#: git-gui.sh:2171
+msgid "Initial Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2172
+msgid "Amended Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2173
+msgid "Amended Initial Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2174
+msgid "Amended Merge Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2175
+msgid "Merge Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2176
+msgid "Commit Message:"
+msgstr ""
+
+#: git-gui.sh:2221 git-gui.sh:2359
+msgid "Copy All"
+msgstr "Alle kopieren"
+
+#: git-gui.sh:2347
+msgid "Refresh"
+msgstr "Aktualisieren"
+
+#: git-gui.sh:2368
+msgid "Apply/Reverse Hunk"
+msgstr ""
+
+#: git-gui.sh:2374
+msgid "Decrease Font Size"
+msgstr "Schriftgröße verkleinern"
+
+#: git-gui.sh:2378
+msgid "Increase Font Size"
+msgstr "Schriftgröße vergrößern"
+
+#: git-gui.sh:2383
+msgid "Show Less Context"
+msgstr ""
+
+#: git-gui.sh:2390
+msgid "Show More Context"
+msgstr ""
-- 
1.5.3.rc2.4.g726f9

>From a91dc11906f6ced938dc79bded2fa46fcc147524 Mon Sep 17 00:00:00 2001
From: Christian Stimming <stimming@xxxxxxx>
Date: Thu, 19 Jul 2007 12:50:32 +0200
Subject: [PATCH] Makefile rules for message catalog generation and installation.

---
 git-gui/Makefile |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/git-gui/Makefile b/git-gui/Makefile
index 1bac6fe..f6a6ce3 100644
--- a/git-gui/Makefile
+++ b/git-gui/Makefile
@@ -103,6 +103,19 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
 $(GITGUI_BUILT_INS): git-gui
 	$(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
 
+XGETTEXT   ?= xgettext
+msgsdir    ?= $(libdir)/msgs
+msgsdir_SQ  = $(subst ','\'',$(msgsdir))
+PO_TEMPLATE = po/git-gui.pot
+ALL_LINGUAS = de
+
+$(PO_TEMPLATE): $(SCRIPT_SH) $(ALL_LIBFILES)
+	$(XGETTEXT) -k_ -LTcl -o $@ $(SCRIPT_SH) $(ALL_LIBFILES)
+update-po:: $(PO_TEMPLATE)
+	( cd po ; for A in *.po ; do echo Updating $${A} ; msgmerge -U $${A} ../$(PO_TEMPLATE) ; done )
+catalogs:: $(PO_TEMPLATE)
+	( cd po ; for A in $(ALL_LINGUAS) ; do echo Generating catalog $${A} ; msgfmt --statistics --tcl $${A}.po -l $${A} -d . ; done )
+
 lib/tclIndex: $(ALL_LIBFILES)
 	$(QUIET_INDEX)if echo \
 	  $(foreach p,$(PRELOAD_FILES),source $p\;) \
@@ -136,7 +149,7 @@ GIT-GUI-VARS: .FORCE-GIT-GUI-VARS
 		echo 1>$@ "$$VARS"; \
 	fi
 
-all:: $(ALL_PROGRAMS) lib/tclIndex
+all:: $(ALL_PROGRAMS) lib/tclIndex catalogs
 
 install: all
 	$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(gitexecdir_SQ)' $(INSTALL_D1)
@@ -145,6 +158,8 @@ install: all
 	$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(INSTALL_D1)
 	$(QUIET)$(INSTALL_R0)lib/tclIndex $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)'
 	$(QUIET)$(foreach p,$(ALL_LIBFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(libdir_SQ)' &&) true
+	$(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(INSTALL_D1)
+	$(QUIET)$(foreach p,$(ALL_LINGUAS), $(INSTALL_R0)po/$p.msg $(INSTALL_R1) '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
 
 dist-version:
 	@mkdir -p $(TARDIR)
-- 
1.5.3.rc2.4.g726f9


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux