git-gui: add some strings to translation
Most of these changes were suggested by Shawn Pearce in an answer to Johannes Schindelin. Some strings for the blame module were added too. [sp: Minor edits in blame module formatting] Signed-off-by: Michele Ballabio <barra_cuda@katamail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Michele Ballabio committed
Sep 13, 2007 at 15:19 UTC
c8c4854bec30b03b8e3a56a9b5e52ff358210140
8 files changed
+43
-43
git-gui.sh
+15
-15
@@ -37,7 +37,7 @@ if {[catch {package require Tcl 8.4} err]
37
tk_messageBox \
38
-icon error \
39
-type ok \
40
- -title "git-gui: fatal error" \
40
+ -title [mc "git-gui: fatal error"] \
41
-message $err
42
exit 1
43
}
@@ -526,7 +526,7 @@ if {[catch {set _git_version [git --version]} err]} {
526
tk_messageBox \
527
-icon error \
528
-type ok \
529
- -title "git-gui: fatal error" \
529
+ -title [mc "git-gui: fatal error"] \
530
-message "Cannot determine Git version:
531
532
$err
@@ -539,7 +539,7 @@ if {![regsub {^git version } $_git_version {} _git_version]} {
539
tk_messageBox \
540
-icon error \
541
-type ok \
542
- -title "git-gui: fatal error" \
542
+ -title [mc "git-gui: fatal error"] \
543
-message [append [mc "Cannot parse Git version string:"] "\n\n$_git_version"]
544
exit 1
545
}
@@ -621,7 +621,7 @@ if {[git-version < 1.5]} {
621
tk_messageBox \
622
-icon error \
623
-type ok \
624
- -title "git-gui: fatal error" \
624
+ -title [mc "git-gui: fatal error"] \
625
-message "[appname] requires Git 1.5.0 or later.
626
627
You are using [git-version]:
@@ -640,7 +640,7 @@ if {[catch {set fd [open $idx r]} err]} {
640
tk_messageBox \
641
-icon error \
642
-type ok \
643
- -title "git-gui: fatal error" \
643
+ -title [mc "git-gui: fatal error"] \
644
-message $err
645
exit 1
646
}
@@ -737,7 +737,7 @@ if {$_prefix ne {}} {
737
regsub -all {[^/]+/} $_prefix ../ cdup
738
if {[catch {cd $cdup} err]} {
739
catch {wm withdraw .}
740
- error_popup "Cannot move to top of working directory:\n\n$err"
740
+ error_popup [append [mc "Cannot move to top of working directory:"] "\n\n$err"]
741
exit 1
742
}
743
unset cdup
@@ -2077,7 +2077,7 @@ blame {
2077
}
2078
blame {
2079
if {$head eq {} && ![file exists $path]} {
2080
- puts stderr "fatal: cannot stat path $path: No such file or directory"
2080
+ puts stderr [mc "fatal: cannot stat path %s: No such file or directory" $path]
2081
exit 1
2082
}
2083
blame::new $head $path
@@ -2588,13 +2588,13 @@ focus -force $ui_comm
2588
if {[is_Cygwin]} {
2589
set ignored_env 0
2590
set suggest_user {}
2591
- set msg "Possible environment issues exist.
2591
+ set msg [mc "Possible environment issues exist.
2592
2593
The following environment variables are probably
2594
going to be ignored by any Git subprocess run
2595
-by [appname]:
2595
+by %s:
2596
2597
-"
2597
+" [appname]]
2598
foreach name [array names env] {
2599
switch -regexp -- $name {
2600
{^GIT_INDEX_FILE$} -
@@ -2618,18 +2618,18 @@ by [appname]:
2618
}
2619
}
2620
if {$ignored_env > 0} {
2621
- append msg "
2621
+ append msg [mc "
2622
This is due to a known issue with the
2623
-Tcl binary distributed by Cygwin."
2623
+Tcl binary distributed by Cygwin."]
2624
2625
if {$suggest_user ne {}} {
2626
- append msg "
2626
+ append msg [mc "
2627
2628
-A good replacement for $suggest_user
2628
+A good replacement for %s
2629
is placing values for the user.name and
2630
user.email settings into your personal
2631
~/.gitconfig file.
2632
-"
2632
+" $suggest_user]
2633
}
2634
warn_popup $msg
2635
}
lib/blame.tcl
+12
-12
@@ -470,7 +470,7 @@ method _read_file {fd jump} {
470
471
_exec_blame $this $w_asim @asim_data \
472
[list] \
473
- { copy/move tracking}
473
+ [mc "Loading copy/move tracking annotations..."]
474
}
475
} ifdeleted { catch {close $fd} }
476
@@ -489,8 +489,8 @@ method _exec_blame {cur_w cur_d options cur_s} {
489
set blame_lines 0
490
491
$status start \
492
- "Loading$cur_s annotations..." \
493
- {lines annotated}
492
+ $cur_s \
493
+ [mc "lines annotated"]
494
}
495
496
method _read_blame {fd cur_w cur_d} {
@@ -671,10 +671,10 @@ method _read_blame {fd cur_w cur_d} {
671
if {$cur_w eq $w_asim} {
672
_exec_blame $this $w_amov @amov_data \
673
$original_options \
674
- { original location}
674
+ [mc "Loading original location annotations..."]
675
} else {
676
set current_fd {}
677
- $status stop {Annotation complete.}
677
+ $status stop [mc "Annotation complete."]
678
}
679
} else {
680
$status update $blame_lines $total_lines
@@ -728,7 +728,7 @@ method _showcommit {cur_w lno} {
728
729
if {$dat eq {}} {
730
set cmit {}
731
- $w_cviewer insert end "Loading annotation..." still_loading
731
+ $w_cviewer insert end [mc "Loading annotation..."] still_loading
732
} else {
733
set cmit [lindex $dat 0]
734
set file [lindex $dat 1]
@@ -784,16 +784,16 @@ method _showcommit {cur_w lno} {
784
}
785
786
$w_cviewer insert end "commit $cmit\n" header_key
787
- $w_cviewer insert end "Author:\t" header_key
787
+ $w_cviewer insert end [append [mc "Author:"] "\t"] header_key
788
$w_cviewer insert end "$author_name $author_email" header_val
789
$w_cviewer insert end " $author_time\n" header_val
790
791
- $w_cviewer insert end "Committer:\t" header_key
791
+ $w_cviewer insert end [append [mc "Committer:"] "\t"] header_key
792
$w_cviewer insert end "$committer_name $committer_email" header_val
793
$w_cviewer insert end " $committer_time\n" header_val
794
795
if {$file ne $path} {
796
- $w_cviewer insert end "Original File:\t" header_key
796
+ $w_cviewer insert end [append [mc "Original File:"] "\t"] header_key
797
$w_cviewer insert end "[escape_path $file]\n" header_val
798
}
799
@@ -907,18 +907,18 @@ method _open_tooltip {cur_w} {
907
catch {set summary $header($cmit,summary)}
908
catch {set author_time [foramt_date $header($cmit,author-time)]}
909
910
- $tooltip_t insert end "Originally By:\n" section_header
910
+ $tooltip_t insert end [append [mc "Originally By:"] "\n"] section_header
911
$tooltip_t insert end "commit $cmit\n"
912
$tooltip_t insert end "$author_name $author_time\n"
913
$tooltip_t insert end "$summary\n"
914
915
if {$file ne $path} {
916
- $tooltip_t insert end "In File: " section_header
916
+ $tooltip_t insert end [append [mc "In File:"] " "] section_header
917
$tooltip_t insert end "$file\n"
918
}
919
920
$tooltip_t insert end "\n"
921
- $tooltip_t insert end "Copied Or Moved Here By:\n" section_header
921
+ $tooltip_t insert end [append [mc "Copied Or Moved Here By:"] "\n"] section_header
922
$tooltip_t insert end $save
923
}
924
lib/checkout_op.tcl
+3
-3
@@ -124,7 +124,7 @@ method _finish_fetch {ok} {
124
}
125
if {[catch {set new_hash [git rev-parse --verify "$l_trck^0"]} err]} {
126
set ok 0
127
- $w_cons insert "fatal: Cannot resolve $l_trck"
127
+ $w_cons insert [mc "fatal: Cannot resolve %s" $l_trck]
128
$w_cons insert $err
129
}
130
}
@@ -319,7 +319,7 @@ method _readtree {} {
319
320
set readtree_d {}
321
$::main_status start \
322
- "Updating working directory to '[_name $this]'..." \
322
+ [mc "Updating working directory to '%s'..." [_name $this]] \
323
{files checked out}
324
325
set fd [git_read --stderr read-tree \
@@ -443,7 +443,7 @@ If you wanted to be on a branch, create one now starting from 'This Detached Che
443
$ui_comm delete 0.0 end
444
$ui_comm edit reset
445
$ui_comm edit modified false
446
- rescan [list ui_status "Checked out '$name'."]
446
+ rescan [list ui_status [mc "Checked out '%s'." $name]]
447
} else {
448
repository_state commit_type HEAD MERGE_HEAD
449
set PARENT $HEAD
lib/commit.tcl
+2
-2
@@ -272,7 +272,7 @@ proc commit_committree {fd_wt curHEAD msg} {
272
&& [string length $old_tree] == 45} {
273
set old_tree [string range $old_tree 5 end]
274
} else {
275
- error "Commit $PARENT appears to be corrupt"
275
+ error [mc "Commit %s appears to be corrupt" $PARENT]
276
}
277
278
if {$tree_id eq $old_tree} {
@@ -300,7 +300,7 @@ A rescan will be automatically started now.
300
if {$use_enc ne {}} {
301
fconfigure $msg_wt -encoding $use_enc
302
} else {
303
- puts stderr "warning: Tcl does not support encoding '$enc'."
303
+ puts stderr [mc "warning: Tcl does not support encoding '%s'." $enc]
304
fconfigure $msg_wt -encoding utf-8
305
}
306
puts -nonewline $msg_wt $msg
lib/database.tcl
+3
-3
@@ -105,11 +105,11 @@ proc hint_gc {} {
105
set objects_current [expr {$objects_current * 256}]
106
set object_limit [expr {$object_limit * 256}]
107
if {[ask_popup \
108
- "This repository currently has approximately $objects_current loose objects.
108
+ [mc "This repository currently has approximately %i loose objects.
109
110
-To maintain optimal performance it is strongly recommended that you compress the database when more than $object_limit loose objects exist.
110
+To maintain optimal performance it is strongly recommended that you compress the database when more than %i loose objects exist.
111
112
-Compress the database now?"] eq yes} {
112
+Compress the database now?" $objects_current $object_limit]] eq yes} {
113
do_gc
114
}
115
}
lib/diff.tcl
+4
-4
@@ -78,7 +78,7 @@ proc show_diff {path w {lno {}}} {
78
set current_diff_path $path
79
set current_diff_side $w
80
set current_diff_header {}
81
- ui_status "Loading diff of [escape_path $path]..."
81
+ ui_status [mc "Loading diff of %s..." [escape_path $path]]
82
83
# - Git won't give us the diff, there's nothing to compare to!
84
#
@@ -111,7 +111,7 @@ proc show_diff {path w {lno {}}} {
111
} err ]} {
112
set diff_active 0
113
unlock_index
114
- ui_status "Unable to display [escape_path $path]"
114
+ ui_status [mc "Unable to display %s" [escape_path $path]]
115
error_popup [append [mc "Error loading file:"] "\n\n$err"]
116
return
117
}
@@ -131,7 +131,7 @@ proc show_diff {path w {lno {}}} {
131
}
132
if {[string first "\0" $content] != -1} {
133
$ui_diff insert end \
134
- "* Binary file (not showing content)." \
134
+ [mc "* Binary file (not showing content)."] \
135
d_@
136
} else {
137
if {$sz > $max_sz} {
@@ -181,7 +181,7 @@ proc show_diff {path w {lno {}}} {
181
if {[catch {set fd [eval git_read --nice $cmd]} err]} {
182
set diff_active 0
183
unlock_index
184
- ui_status "Unable to display [escape_path $path]"
184
+ ui_status [mc "Unable to display %s" [escape_path $path]]
185
error_popup [append [mc "Error loading diff:"] "\n\n$err"]
186
return
187
}
lib/index.tcl
+2
-2
@@ -268,7 +268,7 @@ proc do_unstage_selection {} {
268
[array names selected_paths]
269
} elseif {$current_diff_path ne {}} {
270
unstage_helper \
271
- "Unstaging [short_path $current_diff_path] from commit" \
271
+ [mc "Unstaging %s from commit" [short_path $current_diff_path]] \
272
[list $current_diff_path]
273
}
274
}
@@ -312,7 +312,7 @@ proc do_add_selection {} {
312
[array names selected_paths]
313
} elseif {$current_diff_path ne {}} {
314
add_helper \
315
- "Adding [short_path $current_diff_path]" \
315
+ [mc "Adding %s" [short_path $current_diff_path]] \
316
[list $current_diff_path]
317
}
318
}
lib/remote_branch_delete.tcl
+2
-2
@@ -181,9 +181,9 @@ method _delete {} {
181
}
182
183
if {$not_merged ne {}} {
184
- set msg "The following branches are not completely merged into $check_head:
184
+ set msg [mc "The following branches are not completely merged into %s:
185
186
- - [join $not_merged "\n - "]"
186
+ - %s" $check_head [join $not_merged "\n - "]]
187
188
if {$need_fetch} {
189
append msg "\n\n" [mc "One or more of the merge tests failed because you have not fetched the necessary commits. Try fetching from %s first." $uri]