diff options
| author | Shawn O. Pearce <spearce@spearce.org> | 2007-09-14 01:50:09 -0400 |
|---|---|---|
| committer | Shawn O. Pearce <spearce@spearce.org> | 2007-09-14 01:51:18 -0400 |
| commit | 31bb1d1b2d1e893836b0d2b091fed9e39ee84853 (patch) | |
| tree | 88f778a7c48f2941c5c89a137c0f162eab68250d /git-gui.sh | |
| parent | bba060462c8732a5cb46ea00165198a9579517ae (diff) | |
| download | git-31bb1d1b2d1e893836b0d2b091fed9e39ee84853.tar.xz | |
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-x | git-gui.sh | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/git-gui.sh b/git-gui.sh index 2d7a2a82ca..4682487ade 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 |
