2222use File::Temp qw( tempdir) ;
2323use Getopt::Long qw( :config pass_through) ;
2424use Git;
25+ use Git::I18N;
2526
2627sub 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' ;
126127Combined diff formats ('-c' and '--cc') are not supported in
127128directory diff mode ('-d' and '--dir-diff').
128129EOF
@@ -338,15 +339,15 @@ sub main
338339 if (length ($opts {difftool_cmd }) > 0) {
339340 $ENV {GIT_DIFF_TOOL } = $opts {difftool_cmd };
340341 } else {
341- print " No <tool> given for --tool=<tool>\n " ;
342+ print __( " No <tool> given for --tool=<tool>\n " ) ;
342343 usage(1);
343344 }
344345 }
345346 if (defined ($opts {extcmd })) {
346347 if (length ($opts {extcmd }) > 0) {
347348 $ENV {GIT_DIFFTOOL_EXTCMD } = $opts {extcmd };
348349 } else {
349- print " No <cmd> given for --extcmd=<cmd>\n " ;
350+ print __( " No <cmd> given for --extcmd=<cmd>\n " ) ;
350351 usage(1);
351352 }
352353 }
@@ -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