aboutsummaryrefslogtreecommitdiff
path: root/lib/shortcut.tcl
diff options
context:
space:
mode:
authorVasco Almeida <vascomalmeida@sapo.pt>2016-05-08 10:52:57 +0000
committerPat Thoyts <patthoyts@users.sourceforge.net>2016-10-03 23:40:10 +0100
commita3d97afaa8b4187d62496ccc9cf268e8bd47c5db (patch)
tree3ae071e6bc2729422c9ba4c98cfe633199de2453 /lib/shortcut.tcl
parent43c65a85c4160fc18469ed0af9a41ee2f78b04f4 (diff)
downloadgit-a3d97afaa8b4187d62496ccc9cf268e8bd47c5db.tar.gz
git-a3d97afaa8b4187d62496ccc9cf268e8bd47c5db.tar.xz
git-gui: fix incorrect use of Tcl append command
Fix wrong use of append command in strings marked for translation. According to Tcl/Tk Documentation [1], append varName ?value value value ...? appends all value arguments to the current value of variable varName. This means that append "[appname] ([reponame]): " [mc "File Viewer"] is setting a variable named "[appname] ([reponame]): " to the output of [mc "File Viewer"], rather than returning the concatenation of both expressions as one might expect. The format for some strings enables, for instance, a French translator to translate like "%s (%s) : Create Branch" (space before colon). Conversely, strings already translated will be marked as fuzzy and the translator must update them herself. For some cases, use alternative way for concatenation instead of using strcat procedure defined in git-gui.sh. Reference: 31bb1d1 ("git-gui: Paper bag fix missing translated strings", 2007-09-14) fixes the same issue slightly differently. [1] http://www.tcl.tk/man/tcl/TclCmd/append.htm Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Diffstat (limited to 'lib/shortcut.tcl')
-rw-r--r--lib/shortcut.tcl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/shortcut.tcl b/lib/shortcut.tcl
index 39d23f96d..97d1d7aa0 100644
--- a/lib/shortcut.tcl
+++ b/lib/shortcut.tcl
@@ -5,7 +5,7 @@ proc do_windows_shortcut {} {
global _gitworktree
set fn [tk_getSaveFile \
-parent . \
- -title [append "[appname] ([reponame]): " [mc "Create Desktop Icon"]] \
+ -title [mc "%s (%s): Create Desktop Icon" [appname] [reponame]] \
-initialfile "Git [reponame].lnk"]
if {$fn != {}} {
if {[file extension $fn] ne {.lnk}} {
@@ -40,7 +40,7 @@ proc do_cygwin_shortcut {} {
}
set fn [tk_getSaveFile \
-parent . \
- -title [append "[appname] ([reponame]): " [mc "Create Desktop Icon"]] \
+ -title [mc "%s (%s): Create Desktop Icon" [appname] [reponame]] \
-initialdir $desktop \
-initialfile "Git [reponame].lnk"]
if {$fn != {}} {
@@ -72,7 +72,7 @@ proc do_macosx_app {} {
set fn [tk_getSaveFile \
-parent . \
- -title [append "[appname] ([reponame]): " [mc "Create Desktop Icon"]] \
+ -title [mc "%s (%s): Create Desktop Icon" [appname] [reponame]] \
-initialdir [file join $env(HOME) Desktop] \
-initialfile "Git [reponame].app"]
if {$fn != {}} {