diff options
author | Christian Stimming <chs@ckiste.goetheallee> | 2007-07-21 14:21:34 +0200 |
---|---|---|
committer | Johannes Schindelin <johannes.schindelin@gmx.de> | 2007-09-02 16:54:48 +0100 |
commit | 1ac17950e93a956d01b042db3de70010195eddcc (patch) | |
tree | 71f6b9f721c2ea5e218349241f12f7def2853d9f /lib/option.tcl | |
parent | git-gui: Initialize Tcl's msgcat library for internationalization (diff) | |
download | tgif-1ac17950e93a956d01b042db3de70010195eddcc.tar.xz |
Mark strings for translation.
The procedure [mc ...] will translate the strings through msgcat.
Strings must be enclosed in quotes, not in braces, because otherwise
xgettext cannot extract them properly, although on the Tcl side both
delimiters would work fine.
[jes: I merged the later patches to that end.]
Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Diffstat (limited to 'lib/option.tcl')
-rw-r--r-- | lib/option.tcl | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/lib/option.tcl b/lib/option.tcl index aa9f783afd..31c7d47f35 100644 --- a/lib/option.tcl +++ b/lib/option.tcl @@ -62,7 +62,7 @@ proc do_about {} { toplevel $w wm geometry $w "+[winfo rootx .]+[winfo rooty .]" - label $w.header -text "About [appname]" \ + label $w.header -text [mc "About %s" [appname]] \ -font font_uibold pack $w.header -side top -fill x @@ -74,8 +74,7 @@ proc do_about {} { pack $w.buttons -side bottom -fill x -pady 10 -padx 10 label $w.desc \ - -text "git-gui - a graphical user interface for Git. -$copyright" \ + -text "[mc "git-gui - a graphical user interface for Git."]\n$copyright" \ -padx 5 -pady 5 \ -justify left \ -anchor w \ @@ -157,48 +156,48 @@ proc do_options {} { toplevel $w wm geometry $w "+[winfo rootx .]+[winfo rooty .]" - label $w.header -text "Options" \ + label $w.header -text [mc "Options"] \ -font font_uibold pack $w.header -side top -fill x frame $w.buttons - button $w.buttons.restore -text {Restore Defaults} \ + button $w.buttons.restore -text [mc "Restore Defaults"] \ -default normal \ -command do_restore_defaults pack $w.buttons.restore -side left - button $w.buttons.save -text Save \ + button $w.buttons.save -text [mc Save] \ -default active \ -command [list do_save_config $w] pack $w.buttons.save -side right - button $w.buttons.cancel -text {Cancel} \ + button $w.buttons.cancel -text [mc "Cancel"] \ -default normal \ -command [list destroy $w] pack $w.buttons.cancel -side right -padx 5 pack $w.buttons -side bottom -fill x -pady 10 -padx 10 - labelframe $w.repo -text "[reponame] Repository" - labelframe $w.global -text {Global (All Repositories)} + labelframe $w.repo -text [mc "%s Repository" [reponame]] + labelframe $w.global -text [mc "Global (All Repositories)"] pack $w.repo -side left -fill both -expand 1 -pady 5 -padx 5 pack $w.global -side right -fill both -expand 1 -pady 5 -padx 5 set optid 0 foreach option { - {t user.name {User Name}} - {t user.email {Email Address}} - - {b merge.summary {Summarize Merge Commits}} - {i-1..5 merge.verbosity {Merge Verbosity}} - {b merge.diffstat {Show Diffstat After Merge}} - - {b gui.trustmtime {Trust File Modification Timestamps}} - {b gui.pruneduringfetch {Prune Tracking Branches During Fetch}} - {b gui.matchtrackingbranch {Match Tracking Branches}} - {i-0..99 gui.diffcontext {Number of Diff Context Lines}} - {t gui.newbranchtemplate {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 { @@ -246,7 +245,7 @@ proc do_options {} { foreach option $font_descs { set name [lindex $option 0] set font [lindex $option 1] - set text [lindex $option 2] + set text [eval [lindex $option 2]] set global_config_new(gui.$font^^family) \ [font configure $font -family] @@ -272,7 +271,7 @@ proc do_options {} { bind $w <Visibility> "grab $w; focus $w.buttons.save" bind $w <Key-Escape> "destroy $w" bind $w <Key-Return> [list do_save_config $w] - wm title $w "[appname] ([reponame]): Options" + wm title $w [append "[appname] ([reponame]): " [mc "Options"]] tkwait window $w } @@ -303,7 +302,7 @@ proc do_restore_defaults {} { proc do_save_config {w} { if {[catch {save_config} err]} { - error_popup "Failed to completely save options:\n\n$err" + error_popup [append [mc "Failed to completely save options:"] "\n\n$err"] } reshow_diff destroy $w |