summaryrefslogtreecommitdiff
path: root/git-gui.sh
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-09-02 02:22:42 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-09-02 02:22:42 (GMT)
commitd4b0ccd931cc29f35e8f8493445af27ea72ed03e (patch)
treec09db773da8574437cca45467ce9d45063226a9b /git-gui.sh
parentfc703c209d415fe20ad5551465b5b68b8ab8b046 (diff)
downloadgit-d4b0ccd931cc29f35e8f8493445af27ea72ed03e.zip
git-d4b0ccd931cc29f35e8f8493445af27ea72ed03e.tar.gz
git-d4b0ccd931cc29f35e8f8493445af27ea72ed03e.tar.bz2
git-gui: Initialize Tcl's msgcat library for internationalization
Tcl's msgcat library and corresponding mc procedure can locate a translated string for any user message, provided that it is first given a directory where the *.msg files are located containing the translations. During installation we will place the translations in lib/msgs/, so we need to inform msgcat of this location once we determine it during startup. Our source code tree however will store all of the translations within the po/ directory, so we need to special case this variant. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui.sh')
-rwxr-xr-xgit-gui.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 4ea6e91..486d36e 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -51,8 +51,12 @@ set oguirel {@@GITGUI_RELATIVE@@}
if {$oguirel eq {1}} {
set oguilib [file dirname [file dirname [file normalize $argv0]]]
set oguilib [file join $oguilib share git-gui lib]
+ set oguimsg [file join $oguilib msgs]
} elseif {[string match @@* $oguirel]} {
set oguilib [file join [file dirname [file normalize $argv0]] lib]
+ set oguimsg [file join [file dirname [file normalize $argv0]] po]
+} else {
+ set oguimsg [file join $oguilib msgs]
}
unset oguirel
@@ -76,6 +80,16 @@ if {![catch {set _verbose $env(GITGUI_VERBOSE)}]} {
######################################################################
##
+## Internationalization (i18n) through msgcat and gettext. See
+## http://www.gnu.org/software/gettext/manual/html_node/Tcl.html
+
+package require msgcat
+namespace import ::msgcat::mc
+::msgcat::mcload $oguimsg
+unset oguimsg
+
+######################################################################
+##
## read only globals
set _appname [lindex [file split $argv0] end]