@matheusbsbs / matheus-bagliano / commits / 8d849957d8
Fork 0

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 <bernt@norang.ca> Signed-off-by: Paul Mackerras <paulus@samba.org>

Bernt Hansen committed Nov 2, 2009 at 07:41 UTC 8d849957d81fc0480a52570d66cc3c2a688ecb1b
1 file changed +4 -4
gitk
+4 -4
@@ -1787,10 +1787,10 @@ proc make_transient {window origin} {
1787 }
1788 }
1789
1790 -proc show_error {w top msg} {
1790 +proc show_error {w top msg {mc mc}} {
1791 message $w.m -text $msg -justify center -aspect 400
1792 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"
1794 pack $w.ok -side bottom -fill x
1795 bind $top <Visibility> "grab $top; focus $top"
1796 bind $top <Key-Return> "destroy $top"
@@ -11034,8 +11034,8 @@ proc get_path_encoding {path} {
11034
11035 # First check that Tcl/Tk is recent enough
11036 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
11039 exit 1
11040 }
11041