i18n: send-email: mark warnings and errors for translation

Mark warnings, errors and other messages for translation. Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Vasco Almeida committed Dec 14, 2016 at 11:54 UTC 464931053bba771c670fa52ed6ca2eea72a55109
1 file changed +17 -17
git-send-email.perl
+17 -17
@@ -118,20 +118,20 @@ sub format_2822_time {
118 my $localmin = $localtm[1] + $localtm[2] * 60;
119 my $gmtmin = $gmttm[1] + $gmttm[2] * 60;
120 if ($localtm[0] != $gmttm[0]) {
121 - die "local zone differs from GMT by a non-minute interval\n";
121 + die __("local zone differs from GMT by a non-minute interval\n");
122 }
123 if ((($gmttm[6] + 1) % 7) == $localtm[6]) {
124 $localmin += 1440;
125 } elsif ((($gmttm[6] - 1) % 7) == $localtm[6]) {
126 $localmin -= 1440;
127 } elsif ($gmttm[6] != $localtm[6]) {
128 - die "local time offset greater than or equal to 24 hours\n";
128 + die __("local time offset greater than or equal to 24 hours\n");
129 }
130 my $offset = $localmin - $gmtmin;
131 my $offhour = $offset / 60;
132 my $offmin = abs($offset % 60);
133 if (abs($offhour) >= 24) {
134 - die ("local time offset greater than or equal to 24 hours\n");
134 + die __("local time offset greater than or equal to 24 hours\n");
135 }
136
137 return sprintf("%s, %2d %s %d %02d:%02d:%02d %s%02d%02d",
@@ -199,13 +199,13 @@ sub do_edit {
199 map {
200 system('sh', '-c', $editor.' "$@"', $editor, $_);
201 if (($? & 127) || ($? >> 8)) {
202 - die("the editor exited uncleanly, aborting everything");
202 + die(__("the editor exited uncleanly, aborting everything"));
203 }
204 } @_;
205 } else {
206 system('sh', '-c', $editor.' "$@"', $editor, @_);
207 if (($? & 127) || ($? >> 8)) {
208 - die("the editor exited uncleanly, aborting everything");
208 + die(__("the editor exited uncleanly, aborting everything"));
209 }
210 }
211 }
@@ -299,7 +299,7 @@ my $help;
299 my $rc = GetOptions("h" => \$help,
300 "dump-aliases" => \$dump_aliases);
301 usage() unless $rc;
302 -die "--dump-aliases incompatible with other options\n"
302 +die __("--dump-aliases incompatible with other options\n")
303 if !$help and $dump_aliases and @ARGV;
304 $rc = GetOptions(
305 "sender|from=s" => \$sender,
@@ -362,7 +362,7 @@ unless ($rc) {
362 usage();
363 }
364
365 -die "Cannot run git format-patch from outside a repository\n"
365 +die __("Cannot run git format-patch from outside a repository\n")
366 if $format_patch and not $repo;
367
368 # Now, let's fill any that aren't set in with defaults:
@@ -617,7 +617,7 @@ while (defined(my $f = shift @ARGV)) {
617 }
618
619 if (@rev_list_opts) {
620 - die "Cannot run git format-patch from outside a repository\n"
620 + die __("Cannot run git format-patch from outside a repository\n")
621 unless $repo;
622 push @files, $repo->command('format-patch', '-o', tempdir(CLEANUP => 1), @rev_list_opts);
623 }
@@ -638,7 +638,7 @@ if (@files) {
638 print $_,"\n" for (@files);
639 }
640 } else {
641 - print STDERR "\nNo patch files specified!\n\n";
641 + print STDERR __("\nNo patch files specified!\n\n");
642 usage();
643 }
644
@@ -730,7 +730,7 @@ EOT
730 $sender = $1;
731 next;
732 } elsif (/^(?:To|Cc|Bcc):/i) {
733 - print "To/Cc/Bcc fields are not interpreted yet, they have been ignored\n";
733 + print __("To/Cc/Bcc fields are not interpreted yet, they have been ignored\n");
734 next;
735 }
736 print $c2 $_;
@@ -739,7 +739,7 @@ EOT
739 close $c2;
740
741 if ($summary_empty) {
742 - print "Summary email is empty, skipping it\n";
742 + print __("Summary email is empty, skipping it\n");
743 $compose = -1;
744 }
745 } elsif ($annotate) {
@@ -1316,7 +1316,7 @@ EOF
1316 $_ = ask(__("Send this email? ([y]es|[n]o|[q]uit|[a]ll): "),
1317 valid_re => qr/^(?:yes|y|no|n|quit|q|all|a)/i,
1318 default => $ask_default);
1319 - die "Send this email reply required" unless defined $_;
1319 + die __("Send this email reply required") unless defined $_;
1320 if (/^n/i) {
1321 return 0;
1322 } elsif (/^q/i) {
@@ -1342,7 +1342,7 @@ EOF
1342 } else {
1343
1344 if (!defined $smtp_server) {
1345 - die "The required SMTP server is not properly defined."
1345 + die __("The required SMTP server is not properly defined.")
1346 }
1347
1348 if ($smtp_encryption eq 'ssl') {
@@ -1427,10 +1427,10 @@ EOF
1427 }
1428 print $header, "\n";
1429 if ($smtp) {
1430 - print "Result: ", $smtp->code, ' ',
1430 + print __("Result: "), $smtp->code, ' ',
1431 ($smtp->message =~ /\n([^\n]+\n)$/s), "\n";
1432 } else {
1433 - print "Result: OK\n";
1433 + print __("Result: OK\n");
1434 }
1435 }
1436
@@ -1703,7 +1703,7 @@ sub apply_transfer_encoding {
1703 $message = MIME::Base64::decode($message)
1704 if ($from eq 'base64');
1705
1706 - die "cannot send message as 7bit"
1706 + die __("cannot send message as 7bit")
1707 if ($to eq '7bit' and $message =~ /[^[:ascii:]]/);
1708 return $message
1709 if ($to eq '7bit' or $to eq '8bit');
@@ -1711,7 +1711,7 @@ sub apply_transfer_encoding {
1711 if ($to eq 'quoted-printable');
1712 return MIME::Base64::encode($message, "\n")
1713 if ($to eq 'base64');
1714 - die "invalid transfer encoding";
1714 + die __("invalid transfer encoding");
1715 }
1716
1717 sub unique_email_list {