summaryrefslogtreecommitdiff
path: root/git-gui/lib/diff.tcl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-21 08:00:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-11-21 08:00:56 (GMT)
commitd794d9e70ebb8c767b04f25c03290ef305cd31ab (patch)
tree94b449643ef448eded6b3000400871913b7c0182 /git-gui/lib/diff.tcl
parent183f84365de7b4b1fe0e15cebce80a95023aa1d6 (diff)
parent41188dd1a837df08a959b63a2f56357971fa4549 (diff)
downloadgit-d794d9e70ebb8c767b04f25c03290ef305cd31ab.zip
git-d794d9e70ebb8c767b04f25c03290ef305cd31ab.tar.gz
git-d794d9e70ebb8c767b04f25c03290ef305cd31ab.tar.bz2
Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui: (96 commits) git-gui 0.9.0 git-gui: Bind Meta-T for "Stage To Commit" menu action git-gui: Allow users to set font weights to bold git-gui: Update Japanese strings (part 2) git-gui: Update Japanese strings Updated russian translation of git-gui po2msg: actually output statistics po2msg: ignore untranslated messages po2msg: ignore entries marked with "fuzzy" git-gui: Protect against bad translation strings git-gui: Make sure we get errors from git-update-index More updates and corrections to the russian translation of git-gui Updated Russian translation. git-gui: Update German translation git-gui: Add more terms to glossary. git-gui: Paper bag fix the global config parsing git-gui: Honor a config.mak in git-gui's top level git-gui: Collapse $env(HOME) to ~/ in recent repositories on Windows git-gui: Support cloning Cygwin based work-dirs git-gui: Use proper Windows shortcuts instead of bat files ...
Diffstat (limited to 'git-gui/lib/diff.tcl')
-rw-r--r--git-gui/lib/diff.tcl29
1 files changed, 16 insertions, 13 deletions
diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl
index 694834a..43565e4 100644
--- a/git-gui/lib/diff.tcl
+++ b/git-gui/lib/diff.tcl
@@ -39,13 +39,13 @@ proc handle_empty_diff {} {
set s $file_states($path)
if {[lindex $s 0] ne {_M}} return
- info_popup "No differences detected.
+ info_popup [mc "No differences detected.
-[short_path $path] has no changes.
+%s has no changes.
The modification date of this file was updated by another application, but the content within the file was not changed.
-A rescan will be automatically started to find other files which may have the same state."
+A rescan will be automatically started to find other files which may have the same state." [short_path $path]]
clear_diff
display_file $path __
@@ -78,7 +78,7 @@ proc show_diff {path w {lno {}}} {
set current_diff_path $path
set current_diff_side $w
set current_diff_header {}
- ui_status "Loading diff of [escape_path $path]..."
+ ui_status [mc "Loading diff of %s..." [escape_path $path]]
# - Git won't give us the diff, there's nothing to compare to!
#
@@ -111,13 +111,16 @@ proc show_diff {path w {lno {}}} {
} err ]} {
set diff_active 0
unlock_index
- ui_status "Unable to display [escape_path $path]"
- error_popup "Error loading file:\n\n$err"
+ ui_status [mc "Unable to display %s" [escape_path $path]]
+ error_popup [strcat [mc "Error loading file:"] "\n\n$err"]
return
}
$ui_diff conf -state normal
if {$type eq {submodule}} {
- $ui_diff insert end "* Git Repository (subproject)\n" d_@
+ $ui_diff insert end [append \
+ "* " \
+ [mc "Git Repository (subproject)"] \
+ "\n"] d_@
} elseif {![catch {set type [exec file $path]}]} {
set n [string length $path]
if {[string equal -length $n $path $type]} {
@@ -128,7 +131,7 @@ proc show_diff {path w {lno {}}} {
}
if {[string first "\0" $content] != -1} {
$ui_diff insert end \
- "* Binary file (not showing content)." \
+ [mc "* Binary file (not showing content)."] \
d_@
} else {
if {$sz > $max_sz} {
@@ -178,8 +181,8 @@ proc show_diff {path w {lno {}}} {
if {[catch {set fd [eval git_read --nice $cmd]} err]} {
set diff_active 0
unlock_index
- ui_status "Unable to display [escape_path $path]"
- error_popup "Error loading diff:\n\n$err"
+ ui_status [mc "Unable to display %s" [escape_path $path]]
+ error_popup [strcat [mc "Error loading diff:"] "\n\n$err"]
return
}
@@ -296,14 +299,14 @@ proc apply_hunk {x y} {
set apply_cmd {apply --cached --whitespace=nowarn}
set mi [lindex $file_states($current_diff_path) 0]
if {$current_diff_side eq $ui_index} {
- set mode unstage
+ set failed_msg [mc "Failed to unstage selected hunk."]
lappend apply_cmd --reverse
if {[string index $mi 0] ne {M}} {
unlock_index
return
}
} else {
- set mode stage
+ set failed_msg [mc "Failed to stage selected hunk."]
if {[string index $mi 1] ne {M}} {
unlock_index
return
@@ -328,7 +331,7 @@ proc apply_hunk {x y} {
puts -nonewline $p $current_diff_header
puts -nonewline $p [$ui_diff get $s_lno $e_lno]
close $p} err]} {
- error_popup "Failed to $mode selected hunk.\n\n$err"
+ error_popup [append $failed_msg "\n\n$err"]
unlock_index
return
}