Skip to content

Commit

Permalink
gitk: Skip translation of "wrong Tcl version" message
Browse files Browse the repository at this point in the history
We check the required Tcl version number before we setup msgcat for
language translation.  If the Tcl version is too old just display the
untranslated error text.

The caller of show_error can now pass an alternative function for mc.
The Tcl list function turns the translation into a no-op.

This fixes the error:
    Error in startup script: invalid command name "mc"
when attempting to start gitk with Tcl 8.3.

Tested with both Tcl 8.3 and 8.4.

Signed-off-by: Bernt Hansen <bernt@norang.ca>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Bernt Hansen authored and Paul Mackerras committed Nov 3, 2009
1 parent d40bc70 commit 8d84995
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -1787,10 +1787,10 @@ proc make_transient {window origin} {
}
}

proc show_error {w top msg} {
proc show_error {w top msg {mc mc}} {
message $w.m -text $msg -justify center -aspect 400
pack $w.m -side top -fill x -padx 20 -pady 20
button $w.ok -text [mc OK] -command "destroy $top"
button $w.ok -text [$mc OK] -command "destroy $top"
pack $w.ok -side bottom -fill x
bind $top <Visibility> "grab $top; focus $top"
bind $top <Key-Return> "destroy $top"
Expand Down Expand Up @@ -11034,8 +11034,8 @@ proc get_path_encoding {path} {

# First check that Tcl/Tk is recent enough
if {[catch {package require Tk 8.4} err]} {
show_error {} . [mc "Sorry, gitk cannot run with this version of Tcl/Tk.\n\
Gitk requires at least Tcl/Tk 8.4."]
show_error {} . "Sorry, gitk cannot run with this version of Tcl/Tk.\n\
Gitk requires at least Tcl/Tk 8.4." list
exit 1
}

Expand Down

0 comments on commit 8d84995

Please sign in to comment.