summaryrefslogtreecommitdiff
path: root/git-gui.sh
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-09-14 05:50:09 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-09-14 05:51:18 (GMT)
commit31bb1d1b2d1e893836b0d2b091fed9e39ee84853 (patch)
tree88f778a7c48f2941c5c89a137c0f162eab68250d /git-gui.sh
parentbba060462c8732a5cb46ea00165198a9579517ae (diff)
downloadgit-31bb1d1b2d1e893836b0d2b091fed9e39ee84853.zip
git-31bb1d1b2d1e893836b0d2b091fed9e39ee84853.tar.gz
git-31bb1d1b2d1e893836b0d2b091fed9e39ee84853.tar.bz2
git-gui: Paper bag fix missing translated strings
The Tcl expression "[append [mc Foo] Bar]" does not return the string "FooBar" after translation; instead it is setting the variable Foo to the value Bar, or if Foo is already defined it is appending Bar onto the end of it. This is *not* what we wanted to have happen here. Tcl's join function is actually the correct function but its default joinStr argument is a single space. Unfortunately all of our call sites do not want an extra space added to their string. So we need a small wrapper function to make the call to join with an empty join string. In C this is (roughly) the job of the strcat function. Since strcat is not yet used at the global level it is a reasonable name to use here. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'git-gui.sh')
-rwxr-xr-xgit-gui.sh18
1 files changed, 11 insertions, 7 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 2d7a2a8..4682487 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -96,6 +96,10 @@ proc mc {fmt args} {
return [eval [list format $fmt] $args]
}
+proc strcat {args} {
+ return [join $args {}]
+}
+
::msgcat::mcload $oguimsg
unset oguimsg
@@ -540,7 +544,7 @@ if {![regsub {^git version } $_git_version {} _git_version]} {
-icon error \
-type ok \
-title [mc "git-gui: fatal error"] \
- -message [append [mc "Cannot parse Git version string:"] "\n\n$_git_version"]
+ -message [strcat [mc "Cannot parse Git version string:"] "\n\n$_git_version"]
exit 1
}
@@ -722,7 +726,7 @@ if {[catch {
set _prefix [git rev-parse --show-prefix]
} err]} {
catch {wm withdraw .}
- error_popup [append [mc "Cannot find the git directory:"] "\n\n$err"]
+ error_popup [strcat [mc "Cannot find the git directory:"] "\n\n$err"]
exit 1
}
if {![file isdirectory $_gitdir] && [is_Cygwin]} {
@@ -730,26 +734,26 @@ if {![file isdirectory $_gitdir] && [is_Cygwin]} {
}
if {![file isdirectory $_gitdir]} {
catch {wm withdraw .}
- error_popup [append [mc "Git directory not found:"] "\n\n$_gitdir"]
+ error_popup [strcat [mc "Git directory not found:"] "\n\n$_gitdir"]
exit 1
}
if {$_prefix ne {}} {
regsub -all {[^/]+/} $_prefix ../ cdup
if {[catch {cd $cdup} err]} {
catch {wm withdraw .}
- error_popup [append [mc "Cannot move to top of working directory:"] "\n\n$err"]
+ error_popup [strcat [mc "Cannot move to top of working directory:"] "\n\n$err"]
exit 1
}
unset cdup
} elseif {![is_enabled bare]} {
if {[lindex [file split $_gitdir] end] ne {.git}} {
catch {wm withdraw .}
- error_popup [append [mc "Cannot use funny .git directory:"] "\n\n$_gitdir"]
+ error_popup [strcat [mc "Cannot use funny .git directory:"] "\n\n$_gitdir"]
exit 1
}
if {[catch {cd [file dirname $_gitdir]} err]} {
catch {wm withdraw .}
- error_popup [append [mc "No working directory"] " [file dirname $_gitdir]:\n\n$err"]
+ error_popup [strcat [mc "No working directory"] " [file dirname $_gitdir]:\n\n$err"]
exit 1
}
}
@@ -1658,7 +1662,7 @@ proc apply_config {} {
font configure $font $cn $cv
}
} err]} {
- error_popup [append [mc "Invalid font specified in %s:" "gui.$name"] "\n\n$err"]
+ error_popup [strcat [mc "Invalid font specified in %s:" "gui.$name"] "\n\n$err"]
}
foreach {cn cv} [font configure $font] {
font configure ${font}bold $cn $cv