summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c8dd7f6)
raw | patch | inline | side by side (parent: c8dd7f6)
author | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 12 Sep 2007 20:47:06 +0000 (16:47 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 12 Sep 2007 20:47:06 +0000 (16:47 -0400) |
Ocassionally, one would want to translate the same string used in
different contexts in diffrent ways. This patch provides a wrapper
for msgcat::mc that trims "@@" and anything coming after it, whether
or not the string actually got translated.
Proposed-by: Harri Ilari Tapio Liusvaara <hliusvaa@cc.hut.fi>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
different contexts in diffrent ways. This patch provides a wrapper
for msgcat::mc that trims "@@" and anything coming after it, whether
or not the string actually got translated.
Proposed-by: Harri Ilari Tapio Liusvaara <hliusvaa@cc.hut.fi>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui.sh | patch | blob | history |
diff --git a/git-gui.sh b/git-gui.sh
index afee777f1c0100f5606669d1a3372acb0a206b06..d00758e95af5c2b07d96aebb59f8e34c7168cbb9 100755 (executable)
--- a/git-gui.sh
+++ b/git-gui.sh
## http://www.gnu.org/software/gettext/manual/html_node/Tcl.html
package require msgcat
-namespace import ::msgcat::mc
+
+proc mc {fmt args} {
+ set fmt [::msgcat::mc $fmt]
+ set cmk [string first @@ $fmt]
+ if {$cmk > 0} {
+ set fmt [string range $fmt 0 [expr {$cmk - 1}]]
+ }
+ return [eval [list format $fmt] $args]
+}
+
::msgcat::mcload $oguimsg
unset oguimsg