Skip to content

Commit

Permalink
Mark strings for translation.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christian Stimming authored and Johannes Schindelin committed Sep 2, 2007
1 parent d4b0ccd commit 1ac1795
Show file tree
Hide file tree
Showing 22 changed files with 403 additions and 398 deletions.
265 changes: 133 additions & 132 deletions git-gui.sh

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions lib/blame.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ constructor new {i_commit i_path} {
set path $i_path

make_toplevel top w
wm title $top "[appname] ([reponame]): File Viewer"
wm title $top [append "[appname] ([reponame]): " [mc "File Viewer"]]

frame $w.header -background gold
label $w.header.commit_l \
-text {Commit:} \
-text [mc "Commit:"] \
-background gold \
-anchor w \
-justify left
Expand All @@ -101,7 +101,7 @@ constructor new {i_commit i_path} {
-anchor w \
-justify left
label $w.header.path_l \
-text {File:} \
-text [mc "File:"] \
-background gold \
-anchor w \
-justify left
Expand Down Expand Up @@ -246,7 +246,7 @@ constructor new {i_commit i_path} {

menu $w.ctxm -tearoff 0
$w.ctxm add command \
-label "Copy Commit" \
-label [mc "Copy Commit"] \
-command [cb _copycommit]

foreach i $w_columns {
Expand Down Expand Up @@ -366,7 +366,7 @@ method _load {jump} {
set amov_data [list [list]]
set asim_data [list [list]]

$status show "Reading $commit:[escape_path $path]..."
$status show [mc "Reading %s..." "$commit:[escape_path $path]"]
$w_path conf -text [escape_path $path]
if {$commit eq {}} {
set fd [open $path r]
Expand Down
16 changes: 8 additions & 8 deletions lib/branch_checkout.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,37 @@ field opt_detach 0; # force a detached head case?

constructor dialog {} {
make_toplevel top w
wm title $top "[appname] ([reponame]): Checkout Branch"
wm title $top [append "[appname] ([reponame]): " [mc "Checkout Branch"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}

label $w.header -text {Checkout Branch} -font font_uibold
label $w.header -text [mc "Checkout Branch"] -font font_uibold
pack $w.header -side top -fill x

frame $w.buttons
button $w.buttons.create -text Checkout \
button $w.buttons.create -text [mc Checkout] \
-default active \
-command [cb _checkout]
pack $w.buttons.create -side right
button $w.buttons.cancel -text {Cancel} \
button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10

set w_rev [::choose_rev::new $w.rev {Revision}]
set w_rev [::choose_rev::new $w.rev [mc Revision]]
$w_rev bind_listbox <Double-Button-1> [cb _checkout]
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5

labelframe $w.options -text {Options}
labelframe $w.options -text [mc Options]

checkbutton $w.options.fetch \
-text {Fetch Tracking Branch} \
-text [mc "Fetch Tracking Branch"] \
-variable @opt_fetch
pack $w.options.fetch -anchor nw

checkbutton $w.options.detach \
-text {Detach From Local Branch} \
-text [mc "Detach From Local Branch"] \
-variable @opt_detach
pack $w.options.detach -anchor nw

Expand Down
38 changes: 19 additions & 19 deletions lib/branch_create.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,28 @@ constructor dialog {} {
global repo_config

make_toplevel top w
wm title $top "[appname] ([reponame]): Create Branch"
wm title $top [append "[appname] ([reponame]): " [mc "Create Branch"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}

label $w.header -text {Create New Branch} -font font_uibold
label $w.header -text [mc "Create New Branch"] -font font_uibold
pack $w.header -side top -fill x

frame $w.buttons
button $w.buttons.create -text Create \
button $w.buttons.create -text [mc Create] \
-default active \
-command [cb _create]
pack $w.buttons.create -side right
button $w.buttons.cancel -text {Cancel} \
button $w.buttons.cancel -text [mc Cancel] \
-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.desc -text {Branch Name}
labelframe $w.desc -text [mc "Branch Name"]
radiobutton $w.desc.name_r \
-anchor w \
-text {Name:} \
-text [mc "Name:"] \
-value user \
-variable @name_type
set w_name $w.desc.name_t
Expand All @@ -55,46 +55,46 @@ constructor dialog {} {

radiobutton $w.desc.match_r \
-anchor w \
-text {Match Tracking Branch Name} \
-text [mc "Match Tracking Branch Name"] \
-value match \
-variable @name_type
grid $w.desc.match_r -sticky we -padx {0 5} -columnspan 2

grid columnconfigure $w.desc 1 -weight 1
pack $w.desc -anchor nw -fill x -pady 5 -padx 5

set w_rev [::choose_rev::new $w.rev {Starting Revision}]
set w_rev [::choose_rev::new $w.rev [mc "Starting Revision"]]
pack $w.rev -anchor nw -fill both -expand 1 -pady 5 -padx 5

labelframe $w.options -text {Options}
labelframe $w.options -text [mc Options]

frame $w.options.merge
label $w.options.merge.l -text {Update Existing Branch:}
label $w.options.merge.l -text [mc "Update Existing Branch:"]
pack $w.options.merge.l -side left
radiobutton $w.options.merge.no \
-text No \
-text [mc No] \
-value none \
-variable @opt_merge
pack $w.options.merge.no -side left
radiobutton $w.options.merge.ff \
-text {Fast Forward Only} \
-text [mc "Fast Forward Only"] \
-value ff \
-variable @opt_merge
pack $w.options.merge.ff -side left
radiobutton $w.options.merge.reset \
-text {Reset} \
-text [mc Reset] \
-value reset \
-variable @opt_merge
pack $w.options.merge.reset -side left
pack $w.options.merge -anchor nw

checkbutton $w.options.fetch \
-text {Fetch Tracking Branch} \
-text [mc "Fetch Tracking Branch"] \
-variable @opt_fetch
pack $w.options.fetch -anchor nw

checkbutton $w.options.checkout \
-text {Checkout After Creation} \
-text [mc "Checkout After Creation"] \
-variable @opt_checkout
pack $w.options.checkout -anchor nw
pack $w.options -anchor nw -fill x -pady 5 -padx 5
Expand Down Expand Up @@ -128,7 +128,7 @@ method _create {} {
-type ok \
-title [wm title $w] \
-parent $w \
-message "Please select a tracking branch."
-message [mc "Please select a tracking branch."]
return
}
if {![regsub ^refs/heads/ [lindex $spec 2] {} newbranch]} {
Expand All @@ -137,7 +137,7 @@ method _create {} {
-type ok \
-title [wm title $w] \
-parent $w \
-message "Tracking branch [$w get] is not a branch in the remote repository."
-message [mc "Tracking branch %s is not a branch in the remote repository." [$w get]]
return
}
}
Expand All @@ -150,7 +150,7 @@ method _create {} {
-type ok \
-title [wm title $w] \
-parent $w \
-message "Please supply a branch name."
-message [mc "Please supply a branch name."]
focus $w_name
return
}
Expand All @@ -161,7 +161,7 @@ method _create {} {
-type ok \
-title [wm title $w] \
-parent $w \
-message "'$newbranch' is not an acceptable branch name."
-message [mc "'%s' is not an acceptable branch name." $newbranch]
focus $w_name
return
}
Expand Down
22 changes: 10 additions & 12 deletions lib/branch_delete.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@ constructor dialog {} {
global current_branch

make_toplevel top w
wm title $top "[appname] ([reponame]): Delete Branch"
wm title $top [append "[appname] ([reponame]): " [mc "Delete Branch"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}

label $w.header -text {Delete Local Branch} -font font_uibold
label $w.header -text [mc "Delete Local Branch"] -font font_uibold
pack $w.header -side top -fill x

frame $w.buttons
set w_delete $w.buttons.delete
button $w_delete \
-text Delete \
-text [mc Delete] \
-default active \
-state disabled \
-command [cb _delete]
pack $w_delete -side right
button $w.buttons.cancel \
-text {Cancel} \
-text [mc Cancel] \
-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.list -text {Local Branches}
labelframe $w.list -text [mc "Local Branches"]
set w_heads $w.list.l
listbox $w_heads \
-height 10 \
Expand All @@ -49,9 +49,9 @@ constructor dialog {} {

set w_check [choose_rev::new \
$w.check \
{Delete Only If Merged Into} \
[mc "Delete Only If Merged Into"] \
]
$w_check none {Always (Do not perform merge test.)}
$w_check none [mc "Always (Do not perform merge test.)"]
pack $w.check -anchor nw -fill x -pady 5 -padx 5

foreach h [load_all_heads] {
Expand Down Expand Up @@ -100,7 +100,7 @@ method _delete {} {
lappend to_delete [list $b $o]
}
if {$not_merged ne {}} {
set msg "The following branches are not completely merged into [$w_check get]:
set msg "[mc "The following branches are not completely merged into %s:" [$w_check get]]
- [join $not_merged "\n - "]"
tk_messageBox \
Expand All @@ -112,9 +112,7 @@ method _delete {} {
}
if {$to_delete eq {}} return
if {$check_cmt eq {}} {
set msg {Recovering deleted branches is difficult.

Delete the selected branches?}
set msg [mc "Recovering deleted branches is difficult. \n\n Delete the selected branches?"]
if {[tk_messageBox \
-icon warning \
-type yesno \
Expand All @@ -140,7 +138,7 @@ Delete the selected branches?}
-type ok \
-title [wm title $w] \
-parent $w \
-message "Failed to delete branches:\n$failed"
-message [mc "Failed to delete branches:\n%s" $failed]
}

destroy $w
Expand Down
22 changes: 11 additions & 11 deletions lib/branch_rename.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,32 @@ constructor dialog {} {
global current_branch

make_toplevel top w
wm title $top "[appname] ([reponame]): Rename Branch"
wm title $top [append "[appname] ([reponame]): " [mc "Rename Branch"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
}

set oldname $current_branch
set newname [get_config gui.newbranchtemplate]

label $w.header -text {Rename Branch} -font font_uibold
label $w.header -text [mc "Rename Branch"] -font font_uibold
pack $w.header -side top -fill x

frame $w.buttons
button $w.buttons.rename -text Rename \
button $w.buttons.rename -text [mc Rename] \
-default active \
-command [cb _rename]
pack $w.buttons.rename -side right
button $w.buttons.cancel -text {Cancel} \
button $w.buttons.cancel -text [mc Cancel] \
-command [list destroy $w]
pack $w.buttons.cancel -side right -padx 5
pack $w.buttons -side bottom -fill x -pady 10 -padx 10

frame $w.rename
label $w.rename.oldname_l -text {Branch:}
label $w.rename.oldname_l -text [mc "Branch:"]
eval tk_optionMenu $w.rename.oldname_m @oldname [load_all_heads]

label $w.rename.newname_l -text {New Name:}
label $w.rename.newname_l -text [mc "New Name:"]
entry $w.rename.newname_t \
-borderwidth 1 \
-relief sunken \
Expand Down Expand Up @@ -72,7 +72,7 @@ method _rename {} {
-type ok \
-title [wm title $w] \
-parent $w \
-message "Please select a branch to rename."
-message [mc "Please select a branch to rename."]
focus $w.rename.oldname_m
return
}
Expand All @@ -83,7 +83,7 @@ method _rename {} {
-type ok \
-title [wm title $w] \
-parent $w \
-message "Please supply a branch name."
-message [mc "Please supply a branch name."]
focus $w.rename.newname_t
return
}
Expand All @@ -93,7 +93,7 @@ method _rename {} {
-type ok \
-title [wm title $w] \
-parent $w \
-message "Branch '$newname' already exists."
-message [mc "Branch '%s' already exists." $newname]
focus $w.rename.newname_t
return
}
Expand All @@ -103,7 +103,7 @@ method _rename {} {
-type ok \
-title [wm title $w] \
-parent $w \
-message "We do not like '$newname' as a branch name."
-message [mc "'%s' is not an acceptable branch name." $newname]
focus $w.rename.newname_t
return
}
Expand All @@ -114,7 +114,7 @@ method _rename {} {
-type ok \
-title [wm title $w] \
-parent $w \
-message "Failed to rename '$oldname'.\n\n$err"
-message [append [mc "Failed to rename '%s'." $oldname] "\n\n$err"]
return
}

Expand Down
Loading

0 comments on commit 1ac1795

Please sign in to comment.