{"thread":{"id":"39298","subject":"[PATCH v2] gitk: Remove mc parameter from proc show_error","startedAt":"2015-05-11T19:26:41Z","lastAt":"2015-05-17T04:30:05Z","messageCount":3,"participants":["Alex Henrie","Paul Mackerras"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"261011","messageId":"1431372401-8750-1-git-send-email-alexhenrie24@gmail.com","threadId":"39298","inReplyTo":null,"subject":"[PATCH v2] gitk: Remove mc parameter from proc show_error","fromName":"Alex Henrie","fromEmail":"alexhenrie24@gmail.com","sentAt":"2015-05-11T19:26:41Z","receivedAt":"2015-05-11T19:26:41Z","isPatch":true,"sender":{"key":"alexhenrie24@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5951993?v=4"},"body":"This is a better fix for 8d849957d81fc0480a52570d66cc3c2a688ecb1b.\n\nThis new fix makes the strings \"Sorry, gitk cannot run...\" and \"OK\"\ntranslatable and the string \"mc\" not translatable. It will take effect\nthe next time `make update-po` is run.\n\nmsgcat is now imported before the Tcl/Tk version check so that the mc\nfunction is available even if the version check fails. This should not\nbe a problem because msgcat and ::msgcat::mc were officially added in\nTcl 8.1 (released April 29, 1999) and we are not trying to support\nversions of Tcl older than that.\n\nSigned-off-by: Alex Henrie <alexhenrie24@gmail.com>\n---\n gitk | 46 +++++++++++++++++++++++-----------------------\n 1 file changed, 23 insertions(+), 23 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex c186704..78baeb5 100755\n--- a/gitk\n+++ b/gitk\n@@ -1894,13 +1894,13 @@ proc make_transient {window origin} {\n     }\n }\n \n-proc show_error {w top msg {mc mc}} {\n+proc show_error {w top msg} {\n     global NS\n     if {![info exists NS]} {set NS \"\"}\n     if {[wm state $top] eq \"withdrawn\"} { wm deiconify $top }\n     message $w.m -text $msg -justify center -aspect 400\n     pack $w.m -side top -fill x -padx 20 -pady 20\n-    ${NS}::button $w.ok -default active -text [$mc OK] -command \"destroy $top\"\n+    ${NS}::button $w.ok -default active -text [mc OK] -command \"destroy $top\"\n     pack $w.ok -side bottom -fill x\n     bind $top <Visibility> \"grab $top; focus $top\"\n     bind $top <Key-Return> \"destroy $top\"\n@@ -12016,10 +12016,29 @@ proc get_path_encoding {path} {\n     return $tcl_enc\n }\n \n+## For msgcat loading, first locate the installation location.\n+if { [info exists ::env(GITK_MSGSDIR)] } {\n+    ## Msgsdir was manually set in the environment.\n+    set gitk_msgsdir $::env(GITK_MSGSDIR)\n+} else {\n+    ## Let's guess the prefix from argv0.\n+    set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]\n+    set gitk_libdir [file join $gitk_prefix share gitk lib]\n+    set gitk_msgsdir [file join $gitk_libdir msgs]\n+    unset gitk_prefix\n+}\n+\n+## Internationalization (i18n) through msgcat and gettext. See\n+## http://www.gnu.org/software/gettext/manual/html_node/Tcl.html\n+package require msgcat\n+namespace import ::msgcat::mc\n+## And eventually load the actual message catalog\n+::msgcat::mcload $gitk_msgsdir\n+\n # First check that Tcl/Tk is recent enough\n if {[catch {package require Tk 8.4} err]} {\n-    show_error {} . \"Sorry, gitk cannot run with this version of Tcl/Tk.\\n\\\n-\t\t     Gitk requires at least Tcl/Tk 8.4.\" list\n+    show_error {} . [mc \"Sorry, gitk cannot run with this version of Tcl/Tk.\\n\\\n+\t\t\t Gitk requires at least Tcl/Tk 8.4.\"]\n     exit 1\n }\n \n@@ -12169,25 +12188,6 @@ if {[tk windowingsystem] eq \"aqua\"} {\n     set ctxbut <Button-3>\n }\n \n-## For msgcat loading, first locate the installation location.\n-if { [info exists ::env(GITK_MSGSDIR)] } {\n-    ## Msgsdir was manually set in the environment.\n-    set gitk_msgsdir $::env(GITK_MSGSDIR)\n-} else {\n-    ## Let's guess the prefix from argv0.\n-    set gitk_prefix [file dirname [file dirname [file normalize $argv0]]]\n-    set gitk_libdir [file join $gitk_prefix share gitk lib]\n-    set gitk_msgsdir [file join $gitk_libdir msgs]\n-    unset gitk_prefix\n-}\n-\n-## Internationalization (i18n) through msgcat and gettext. See\n-## http://www.gnu.org/software/gettext/manual/html_node/Tcl.html\n-package require msgcat\n-namespace import ::msgcat::mc\n-## And eventually load the actual message catalog\n-::msgcat::mcload $gitk_msgsdir\n-\n catch {\n     # follow the XDG base directory specification by default. See\n     # http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html\n-- \n2.4.0\n"},{"id":"261403","messageId":"20150517005227.GA21039@iris.ozlabs.ibm.com","threadId":"39298","inReplyTo":"1431372401-8750-1-git-send-email-alexhenrie24@gmail.com","subject":"Re: [PATCH v2] gitk: Remove mc parameter from proc show_error","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2015-05-17T00:52:27Z","receivedAt":"2015-05-17T00:52:27Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Mon, May 11, 2015 at 01:26:41PM -0600, Alex Henrie wrote:\n> This is a better fix for 8d849957d81fc0480a52570d66cc3c2a688ecb1b.\n> \n> This new fix makes the strings \"Sorry, gitk cannot run...\" and \"OK\"\n> translatable and the string \"mc\" not translatable. It will take effect\n> the next time `make update-po` is run.\n> \n> msgcat is now imported before the Tcl/Tk version check so that the mc\n> function is available even if the version check fails. This should not\n> be a problem because msgcat and ::msgcat::mc were officially added in\n> Tcl 8.1 (released April 29, 1999) and we are not trying to support\n> versions of Tcl older than that.\n> \n> Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>\n\nThanks, applied.\n\nPaul.\n"},{"id":"261404","messageId":"CAMMLpeR7a6UUoODs6NN6Vjtvss4pr6VRgC1Huv0R33oUmraxBA@mail.gmail.com","threadId":"39298","inReplyTo":"20150517005227.GA21039@iris.ozlabs.ibm.com","subject":"Re: [PATCH v2] gitk: Remove mc parameter from proc show_error","fromName":"Alex Henrie","fromEmail":"alexhenrie24@gmail.com","sentAt":"2015-05-17T04:30:05Z","receivedAt":"2015-05-17T04:30:05Z","isPatch":true,"sender":{"key":"alexhenrie24@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5951993?v=4"},"body":"2015-05-16 18:52 GMT-06:00 Paul Mackerras <paulus@samba.org>:\n> Thanks, applied.\n\nThank you! (For being patient and reasonable with me on this issue.)\n\n-Alex\n"}]}