28
28
use File::Spec::Functions qw( catfile) ;
29
29
use Error qw( :try) ;
30
30
use Git;
31
+ use Git::I18N;
31
32
32
33
Getopt::Long::Configure qw/ pass_through / ;
33
34
@@ -797,12 +798,12 @@ sub file_declares_8bit_cte {
797
798
}
798
799
799
800
if (!defined $auto_8bit_encoding && scalar %broken_encoding ) {
800
- print " The following files are 8bit, but do not declare " .
801
- " a Content-Transfer-Encoding.\n " ;
801
+ print __( " The following files are 8bit, but do not declare " .
802
+ " a Content-Transfer-Encoding.\n " ) ;
802
803
foreach my $f (sort keys %broken_encoding ) {
803
804
print " $f \n " ;
804
805
}
805
- $auto_8bit_encoding = ask(" Which 8bit encoding should I declare [UTF-8]? " ,
806
+ $auto_8bit_encoding = ask(__( " Which 8bit encoding should I declare [UTF-8]? " ) ,
806
807
valid_re => qr / .{4}/ , confirm_only => 1,
807
808
default => " UTF-8" );
808
809
}
@@ -829,7 +830,7 @@ sub file_declares_8bit_cte {
829
830
# But it's a no-op to run sanitize_address on an already sanitized address.
830
831
$sender = sanitize_address($sender );
831
832
832
- my $to_whom = " To whom should the emails be sent (if anyone)?" ;
833
+ my $to_whom = __( " To whom should the emails be sent (if anyone)?" ) ;
833
834
my $prompting = 0;
834
835
if (!@initial_to && !defined $to_cmd ) {
835
836
my $to = ask(" $to_whom " ,
@@ -859,7 +860,7 @@ sub expand_one_alias {
859
860
860
861
if ($thread && !defined $initial_reply_to && $prompting ) {
861
862
$initial_reply_to = ask(
862
- " Message-ID to be used as In-Reply-To for the first email (if any)? " ,
863
+ __( " Message-ID to be used as In-Reply-To for the first email (if any)? " ) ,
863
864
default => " " ,
864
865
valid_re => qr /\@ .*\. / , confirm_only => 1);
865
866
}
@@ -918,7 +919,10 @@ sub validate_address {
918
919
my $address = shift ;
919
920
while (!extract_valid_address($address )) {
920
921
print STDERR " error: unable to extract a valid address from: $address \n " ;
921
- $_ = ask(" What to do with this address? ([q]uit|[d]rop|[e]dit): " ,
922
+ # TRANSLATORS: Make sure to include [q] [d] [e] in your
923
+ # translation. The program will only accept English input
924
+ # at this point.
925
+ $_ = ask(__(" What to do with this address? ([q]uit|[d]rop|[e]dit): " ),
922
926
valid_re => qr / ^(?:quit|q|drop|d|edit|e)/ i ,
923
927
default => ' q' );
924
928
if (/ ^d/i ) {
@@ -1293,17 +1297,23 @@ sub send_message {
1293
1297
if ($needs_confirm eq " inform" ) {
1294
1298
$confirm_unconfigured = 0; # squelch this message for the rest of this run
1295
1299
$ask_default = " y" ; # assume yes on EOF since user hasn't explicitly asked for confirmation
1296
- print " The Cc list above has been expanded by additional\n " ;
1297
- print " addresses found in the patch commit message. By default\n " ;
1298
- print " send-email prompts before sending whenever this occurs.\n " ;
1299
- print " This behavior is controlled by the sendemail.confirm\n " ;
1300
- print " configuration setting.\n " ;
1301
- print " \n " ;
1302
- print " For additional information, run 'git send-email --help'.\n " ;
1303
- print " To retain the current behavior, but squelch this message,\n " ;
1304
- print " run 'git config --global sendemail.confirm auto'.\n\n " ;
1300
+ print __ <<EOF ;
1301
+ The Cc list above has been expanded by additional
1302
+ addresses found in the patch commit message. By default
1303
+ send-email prompts before sending whenever this occurs.
1304
+ This behavior is controlled by the sendemail.confirm
1305
+ configuration setting.
1306
+
1307
+ For additional information, run 'git send-email --help'.
1308
+ To retain the current behavior, but squelch this message,
1309
+ run 'git config --global sendemail.confirm auto'.
1310
+
1311
+ EOF
1305
1312
}
1306
- $_ = ask(" Send this email? ([y]es|[n]o|[q]uit|[a]ll): " ,
1313
+ # TRANSLATORS: Make sure to include [y] [n] [q] [a] in your
1314
+ # translation. The program will only accept English input
1315
+ # at this point.
1316
+ $_ = ask(__(" Send this email? ([y]es|[n]o|[q]uit|[a]ll): " ),
1307
1317
valid_re => qr / ^(?:yes|y|no|n|quit|q|all|a)/ i ,
1308
1318
default => $ask_default );
1309
1319
die " Send this email reply required" unless defined $_ ;
@@ -1405,7 +1415,7 @@ sub send_message {
1405
1415
if ($quiet ) {
1406
1416
printf (($dry_run ? " Dry-" : " " )." Sent %s \n " , $subject );
1407
1417
} else {
1408
- print (( $dry_run ? " Dry-" : " " ). " OK. Log says:\n " );
1418
+ print ( $dry_run ? __( " Dry-OK. Log says: \n " ) : __( " OK. Log says:\n " ) );
1409
1419
if (!file_name_is_absolute($smtp_server )) {
1410
1420
print " Server: $smtp_server \n " ;
1411
1421
print " MAIL FROM:<$raw_from >\n " ;
@@ -1480,13 +1490,13 @@ sub send_message {
1480
1490
$sauthor = sanitize_address($author );
1481
1491
next if $suppress_cc {' author' };
1482
1492
next if $suppress_cc {' self' } and $sauthor eq $sender ;
1483
- printf (" (mbox) Adding cc: %s from line '%s '\n " ,
1493
+ printf (__( " (mbox) Adding cc: %s from line '%s '\n " ) ,
1484
1494
$1 , $_ ) unless $quiet ;
1485
1495
push @cc , $1 ;
1486
1496
}
1487
1497
elsif (/ ^To:\s +(.*)$ /i ) {
1488
1498
foreach my $addr (parse_address_line($1 )) {
1489
- printf (" (mbox) Adding to: %s from line '%s '\n " ,
1499
+ printf (__( " (mbox) Adding to: %s from line '%s '\n " ) ,
1490
1500
$addr , $_ ) unless $quiet ;
1491
1501
push @to , $addr ;
1492
1502
}
@@ -1500,7 +1510,7 @@ sub send_message {
1500
1510
} else {
1501
1511
next if ($suppress_cc {' cc' });
1502
1512
}
1503
- printf (" (mbox) Adding cc: %s from line '%s '\n " ,
1513
+ printf (__( " (mbox) Adding cc: %s from line '%s '\n " ) ,
1504
1514
$addr , $_ ) unless $quiet ;
1505
1515
push @cc , $addr ;
1506
1516
}
@@ -1534,7 +1544,7 @@ sub send_message {
1534
1544
# So let's support that, too.
1535
1545
$input_format = ' lots' ;
1536
1546
if (@cc == 0 && !$suppress_cc {' cc' }) {
1537
- printf (" (non-mbox) Adding cc: %s from line '%s '\n " ,
1547
+ printf (__( " (non-mbox) Adding cc: %s from line '%s '\n " ) ,
1538
1548
$_ , $_ ) unless $quiet ;
1539
1549
push @cc , $_ ;
1540
1550
} elsif (!defined $subject ) {
@@ -1557,7 +1567,7 @@ sub send_message {
1557
1567
next if $suppress_cc {' bodycc' } and $what =~ / Cc/i ;
1558
1568
}
1559
1569
push @cc , $c ;
1560
- printf (" (body) Adding cc: %s from line '%s '\n " ,
1570
+ printf (__( " (body) Adding cc: %s from line '%s '\n " ) ,
1561
1571
$c , $_ ) unless $quiet ;
1562
1572
}
1563
1573
}
0 commit comments