1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-05 10:36:11 +02:00

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>
This commit is contained in:
Vasco Almeida 2016-12-14 11:54:36 -01:00 committed by Junio C Hamano
parent a4dde4c4e9
commit 464931053b

View File

@ -118,20 +118,20 @@ sub format_2822_time {
my $localmin = $localtm[1] + $localtm[2] * 60;
my $gmtmin = $gmttm[1] + $gmttm[2] * 60;
if ($localtm[0] != $gmttm[0]) {
die "local zone differs from GMT by a non-minute interval\n";
die __("local zone differs from GMT by a non-minute interval\n");
}
if ((($gmttm[6] + 1) % 7) == $localtm[6]) {
$localmin += 1440;
} elsif ((($gmttm[6] - 1) % 7) == $localtm[6]) {
$localmin -= 1440;
} elsif ($gmttm[6] != $localtm[6]) {
die "local time offset greater than or equal to 24 hours\n";
die __("local time offset greater than or equal to 24 hours\n");
}
my $offset = $localmin - $gmtmin;
my $offhour = $offset / 60;
my $offmin = abs($offset % 60);
if (abs($offhour) >= 24) {
die ("local time offset greater than or equal to 24 hours\n");
die __("local time offset greater than or equal to 24 hours\n");
}
return sprintf("%s, %2d %s %d %02d:%02d:%02d %s%02d%02d",
@ -199,13 +199,13 @@ sub do_edit {
map {
system('sh', '-c', $editor.' "$@"', $editor, $_);
if (($? & 127) || ($? >> 8)) {
die("the editor exited uncleanly, aborting everything");
die(__("the editor exited uncleanly, aborting everything"));
}
} @_;
} else {
system('sh', '-c', $editor.' "$@"', $editor, @_);
if (($? & 127) || ($? >> 8)) {
die("the editor exited uncleanly, aborting everything");
die(__("the editor exited uncleanly, aborting everything"));
}
}
}
@ -299,7 +299,7 @@ sub signal_handler {
my $rc = GetOptions("h" => \$help,
"dump-aliases" => \$dump_aliases);
usage() unless $rc;
die "--dump-aliases incompatible with other options\n"
die __("--dump-aliases incompatible with other options\n")
if !$help and $dump_aliases and @ARGV;
$rc = GetOptions(
"sender|from=s" => \$sender,
@ -362,7 +362,7 @@ sub signal_handler {
usage();
}
die "Cannot run git format-patch from outside a repository\n"
die __("Cannot run git format-patch from outside a repository\n")
if $format_patch and not $repo;
# Now, let's fill any that aren't set in with defaults:
@ -617,7 +617,7 @@ sub is_format_patch_arg {
}
if (@rev_list_opts) {
die "Cannot run git format-patch from outside a repository\n"
die __("Cannot run git format-patch from outside a repository\n")
unless $repo;
push @files, $repo->command('format-patch', '-o', tempdir(CLEANUP => 1), @rev_list_opts);
}
@ -638,7 +638,7 @@ sub is_format_patch_arg {
print $_,"\n" for (@files);
}
} else {
print STDERR "\nNo patch files specified!\n\n";
print STDERR __("\nNo patch files specified!\n\n");
usage();
}
@ -730,7 +730,7 @@ sub get_patch_subject {
$sender = $1;
next;
} elsif (/^(?:To|Cc|Bcc):/i) {
print "To/Cc/Bcc fields are not interpreted yet, they have been ignored\n";
print __("To/Cc/Bcc fields are not interpreted yet, they have been ignored\n");
next;
}
print $c2 $_;
@ -739,7 +739,7 @@ sub get_patch_subject {
close $c2;
if ($summary_empty) {
print "Summary email is empty, skipping it\n";
print __("Summary email is empty, skipping it\n");
$compose = -1;
}
} elsif ($annotate) {
@ -1316,7 +1316,7 @@ sub send_message {
$_ = ask(__("Send this email? ([y]es|[n]o|[q]uit|[a]ll): "),
valid_re => qr/^(?:yes|y|no|n|quit|q|all|a)/i,
default => $ask_default);
die "Send this email reply required" unless defined $_;
die __("Send this email reply required") unless defined $_;
if (/^n/i) {
return 0;
} elsif (/^q/i) {
@ -1342,7 +1342,7 @@ sub send_message {
} else {
if (!defined $smtp_server) {
die "The required SMTP server is not properly defined."
die __("The required SMTP server is not properly defined.")
}
if ($smtp_encryption eq 'ssl') {
@ -1427,10 +1427,10 @@ sub send_message {
}
print $header, "\n";
if ($smtp) {
print "Result: ", $smtp->code, ' ',
print __("Result: "), $smtp->code, ' ',
($smtp->message =~ /\n([^\n]+\n)$/s), "\n";
} else {
print "Result: OK\n";
print __("Result: OK\n");
}
}
@ -1703,7 +1703,7 @@ sub apply_transfer_encoding {
$message = MIME::Base64::decode($message)
if ($from eq 'base64');
die "cannot send message as 7bit"
die __("cannot send message as 7bit")
if ($to eq '7bit' and $message =~ /[^[:ascii:]]/);
return $message
if ($to eq '7bit' or $to eq '8bit');
@ -1711,7 +1711,7 @@ sub apply_transfer_encoding {
if ($to eq 'quoted-printable');
return MIME::Base64::encode($message, "\n")
if ($to eq 'base64');
die "invalid transfer encoding";
die __("invalid transfer encoding");
}
sub unique_email_list {