aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasco Almeida <vascomalmeida@sapo.pt>2016-12-14 11:54:39 -0100
committerJunio C Hamano <gitster@pobox.com>2016-12-14 11:00:06 -0800
commita948ebacbf0debd5129f4f528229183c97ff90b1 (patch)
tree6c403d7582ace78815beb17c8a113cba7df2c357
parent70aedfb3ecef6660962d84cbd1455704cd9be5b8 (diff)
downloadgit-a948ebacbf0debd5129f4f528229183c97ff90b1.tar.gz
git-a948ebacbf0debd5129f4f528229183c97ff90b1.tar.xz
i18n: difftool: mark warnings for translation
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-difftool.perl22
1 files changed, 12 insertions, 10 deletions
diff --git a/git-difftool.perl b/git-difftool.perl
index a5790d03a..8d3632e55 100755
--- a/git-difftool.perl
+++ b/git-difftool.perl
@@ -22,6 +22,7 @@ use File::Path qw(mkpath rmtree);
use File::Temp qw(tempdir);
use Getopt::Long qw(:config pass_through);
use Git;
+use Git::I18N;
sub usage
{
@@ -122,7 +123,7 @@ sub setup_dir_diff
my $i = 0;
while ($i < $#rawdiff) {
if ($rawdiff[$i] =~ /^::/) {
- warn << 'EOF';
+ warn __ <<'EOF';
Combined diff formats ('-c' and '--cc') are not supported in
directory diff mode ('-d' and '--dir-diff').
EOF
@@ -338,7 +339,7 @@ sub main
if (length($opts{difftool_cmd}) > 0) {
$ENV{GIT_DIFF_TOOL} = $opts{difftool_cmd};
} else {
- print "No <tool> given for --tool=<tool>\n";
+ print __("No <tool> given for --tool=<tool>\n");
usage(1);
}
}
@@ -346,7 +347,7 @@ sub main
if (length($opts{extcmd}) > 0) {
$ENV{GIT_DIFFTOOL_EXTCMD} = $opts{extcmd};
} else {
- print "No <cmd> given for --extcmd=<cmd>\n";
+ print __("No <cmd> given for --extcmd=<cmd>\n");
usage(1);
}
}
@@ -419,11 +420,11 @@ sub dir_diff
}
if (exists $wt_modified{$file} and exists $tmp_modified{$file}) {
- my $errmsg = "warning: Both files modified: ";
- $errmsg .= "'$workdir/$file' and '$b/$file'.\n";
- $errmsg .= "warning: Working tree file has been left.\n";
- $errmsg .= "warning:\n";
- warn $errmsg;
+ warn sprintf(__(
+ "warning: Both files modified:\n" .
+ "'%s/%s' and '%s/%s'.\n" .
+ "warning: Working tree file has been left.\n" .
+ "warning:\n"), $workdir, $file, $b, $file);
$error = 1;
} elsif (exists $tmp_modified{$file}) {
my $mode = stat("$b/$file")->mode;
@@ -435,8 +436,9 @@ sub dir_diff
}
}
if ($error) {
- warn "warning: Temporary files exist in '$tmpdir'.\n";
- warn "warning: You may want to cleanup or recover these.\n";
+ warn sprintf(__(
+ "warning: Temporary files exist in '%s'.\n" .
+ "warning: You may want to cleanup or recover these.\n"), $tmpdir);
exit(1);
} else {
exit_cleanup($tmpdir, $rc);