22
22
use File::Temp qw( tempdir) ;
23
23
use Getopt::Long qw( :config pass_through) ;
24
24
use Git;
25
+ use Git::I18N;
25
26
26
27
sub usage
27
28
{
@@ -122,7 +123,7 @@ sub setup_dir_diff
122
123
my $i = 0;
123
124
while ($i < $#rawdiff ) {
124
125
if ($rawdiff [$i ] =~ / ^::/ ) {
125
- warn << 'EOF' ;
126
+ warn __ << 'EOF' ;
126
127
Combined diff formats ('-c' and '--cc') are not supported in
127
128
directory diff mode ('-d' and '--dir-diff').
128
129
EOF
@@ -338,15 +339,15 @@ sub main
338
339
if (length ($opts {difftool_cmd }) > 0) {
339
340
$ENV {GIT_DIFF_TOOL } = $opts {difftool_cmd };
340
341
} else {
341
- print " No <tool> given for --tool=<tool>\n " ;
342
+ print __( " No <tool> given for --tool=<tool>\n " ) ;
342
343
usage(1);
343
344
}
344
345
}
345
346
if (defined ($opts {extcmd })) {
346
347
if (length ($opts {extcmd }) > 0) {
347
348
$ENV {GIT_DIFFTOOL_EXTCMD } = $opts {extcmd };
348
349
} else {
349
- print " No <cmd> given for --extcmd=<cmd>\n " ;
350
+ print __( " No <cmd> given for --extcmd=<cmd>\n " ) ;
350
351
usage(1);
351
352
}
352
353
}
@@ -419,11 +420,11 @@ sub dir_diff
419
420
}
420
421
421
422
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 ) ;
427
428
$error = 1;
428
429
} elsif (exists $tmp_modified {$file }) {
429
430
my $mode = stat (" $b /$file " )-> mode;
@@ -435,8 +436,9 @@ sub dir_diff
435
436
}
436
437
}
437
438
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 );
440
442
exit (1);
441
443
} else {
442
444
exit_cleanup($tmpdir , $rc );
0 commit comments