summaryrefslogtreecommitdiff
path: root/git-difftool.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-12-27 00:11:40 -0800
committerJunio C Hamano <gitster@pobox.com>2016-12-27 00:11:40 -0800
commit1d73f8e86d7b4d95e0b7ce53eec2a5f8114722ac (patch)
tree943d4c5dd8f366e610f08ce92fcb5d76291d72f0 /git-difftool.perl
parent95d0367b2e397080d37c4b82dbd2ba10ffa262dc (diff)
parenta948ebacbf0debd5129f4f528229183c97ff90b1 (diff)
downloadgit-1d73f8e86d7b4d95e0b7ce53eec2a5f8114722ac.tar.gz
Merge branch 'va/i18n-perl-scripts'
Porcelain scripts written in Perl are getting internationalized. * va/i18n-perl-scripts: i18n: difftool: mark warnings for translation i18n: send-email: mark composing message for translation i18n: send-email: mark string with interpolation for translation i18n: send-email: mark warnings and errors for translation i18n: send-email: mark strings for translation i18n: add--interactive: mark status words for translation i18n: add--interactive: remove %patch_modes entries i18n: add--interactive: mark edit_hunk_manually message for translation i18n: add--interactive: i18n of help_patch_cmd i18n: add--interactive: mark patch prompt for translation i18n: add--interactive: mark plural strings i18n: clean.c: match string with git-add--interactive.perl i18n: add--interactive: mark strings with interpolation for translation i18n: add--interactive: mark simple here-documents for translation i18n: add--interactive: mark strings for translation Git.pm: add subroutines for commenting lines
Diffstat (limited to 'git-difftool.perl')
-rwxr-xr-xgit-difftool.perl22
1 files changed, 12 insertions, 10 deletions
diff --git a/git-difftool.perl b/git-difftool.perl
index 959822d5f3..674828de39 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
@@ -342,7 +343,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);
}
}
@@ -350,7 +351,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);
}
}
@@ -423,11 +424,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;
@@ -439,8 +440,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);