Skip to content

Commit 289e5f7

Browse files
vascoolgitster
authored andcommitted
i18n: difftool: mark warnings for translation
Signed-off-by: Vasco Almeida <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6599f66 commit 289e5f7

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

git-difftool.perl

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use File::Temp qw(tempdir);
2323
use Getopt::Long qw(:config pass_through);
2424
use Git;
25+
use Git::I18N;
2526

2627
sub usage
2728
{
@@ -122,7 +123,7 @@ sub setup_dir_diff
122123
my $i = 0;
123124
while ($i < $#rawdiff) {
124125
if ($rawdiff[$i] =~ /^::/) {
125-
warn << 'EOF';
126+
warn __ <<'EOF';
126127
Combined diff formats ('-c' and '--cc') are not supported in
127128
directory diff mode ('-d' and '--dir-diff').
128129
EOF
@@ -419,11 +420,11 @@ sub dir_diff
419420
}
420421

421422
if (exists $wt_modified{$file} and exists $tmp_modified{$file}) {
422-
my $errmsg = "warning: Both files modified: ";
423-
$errmsg .= "'$workdir/$file' and '$b/$file'.\n";
424-
$errmsg .= "warning: Working tree file has been left.\n";
425-
$errmsg .= "warning:\n";
426-
warn $errmsg;
423+
warn sprintf(__(
424+
"warning: Both files modified:\n" .
425+
"'%s/%s' and '%s/%s'.\n" .
426+
"warning: Working tree file has been left.\n" .
427+
"warning:\n"), $workdir, $file, $b, $file);
427428
$error = 1;
428429
} elsif (exists $tmp_modified{$file}) {
429430
my $mode = stat("$b/$file")->mode;
@@ -435,8 +436,9 @@ sub dir_diff
435436
}
436437
}
437438
if ($error) {
438-
warn "warning: Temporary files exist in '$tmpdir'.\n";
439-
warn "warning: You may want to cleanup or recover these.\n";
439+
warn sprintf(__(
440+
"warning: Temporary files exist in '%s'.\n" .
441+
"warning: You may want to cleanup or recover these.\n"), $tmpdir);
440442
exit(1);
441443
} else {
442444
exit_cleanup($tmpdir, $rc);

0 commit comments

Comments
 (0)