Skip to content

Commit 8d84995

Browse files
Bernt Hansenpaulusmack
authored andcommitted
gitk: Skip translation of "wrong Tcl version" message
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 <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent d40bc70 commit 8d84995

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gitk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,10 +1787,10 @@ proc make_transient {window origin} {
17871787
}
17881788
}
17891789

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

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

0 commit comments

Comments
 (0)