From: Vasco Almeida <vascomalmeida@sapo.pt>
To: git@vger.kernel.org
Cc: "Vasco Almeida" <vascomalmeida@sapo.pt>,
"Jiang Xin" <worldhello.net@gmail.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Jean-Noël AVILA" <jn.avila@free.fr>,
"Jakub Narębski" <jnareb@gmail.com>,
"David Aguilar" <davvid@gmail.com>,
"Junio C Hamano" <gitster@pobox.com>
Subject: [PATCH v6 00/16] Mark strings in Perl scripts for translation
Date: Fri, 11 Nov 2016 11:45:25 -0100 [thread overview]
Message-ID: <20161111124541.8216-1-vascomalmeida@sapo.pt> (raw)
In-Reply-To: <20161005172110.30801-1-vascomalmeida@sapo.pt>
Mark messages in some perl scripts for translation.
Changes in this re-roll v6:
- Change implementation of prefix_lines subroutine to allow arbitrary
number of strings as arguments.
- Change a few marks for translation hopefully to be easier on the eyes.
Interdiff included below.
Vasco Almeida (16):
Git.pm: add subroutines for commenting lines
i18n: add--interactive: mark strings for translation
i18n: add--interactive: mark simple here-documents for translation
i18n: add--interactive: mark strings with interpolation for
translation
i18n: clean.c: match string with git-add--interactive.perl
i18n: add--interactive: mark plural strings
i18n: add--interactive: mark patch prompt for translation
i18n: add--interactive: i18n of help_patch_cmd
i18n: add--interactive: mark edit_hunk_manually message for
translation
i18n: add--interactive: remove %patch_modes entries
i18n: add--interactive: mark status words for translation
i18n: send-email: mark strings for translation
i18n: send-email: mark warnings and errors for translation
i18n: send-email: mark string with interpolation for translation
i18n: send-email: mark composing message for translation
i18n: difftool: mark warnings for translation
Makefile | 3 +-
builtin/clean.c | 10 +-
git-add--interactive.perl | 329 ++++++++++++++++++++++++++++++----------------
git-difftool.perl | 22 ++--
git-send-email.perl | 191 +++++++++++++++------------
perl/Git.pm | 24 ++++
perl/Git/I18N.pm | 19 ++-
t/t0202/test.pl | 14 +-
8 files changed, 394 insertions(+), 218 deletions(-)
-- >8 --
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 56e6889..3a6d846 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -1068,22 +1068,24 @@ sub edit_hunk_manually {
my $fh;
open $fh, '>', $hunkfile
or die sprintf(__("failed to open hunk edit file for writing: %s"), $!);
- print $fh Git::comment_lines __("Manual hunk edit mode -- see bottom for a quick guide\n");
+ print $fh Git::comment_lines __("Manual hunk edit mode -- see bottom for a quick guide.\n");
print $fh @$oldtext;
my $is_reverse = $patch_mode_flavour{IS_REVERSE};
my ($remove_plus, $remove_minus) = $is_reverse ? ('-', '+') : ('+', '-');
my $comment_line_char = Git::config("core.commentchar") || '#';
- print $fh Git::comment_lines sprintf(__(
-"---
+ print $fh Git::comment_lines sprintf(__ <<EOF, $remove_minus, $remove_plus, $comment_line_char),
+---
To remove '%s' lines, make them ' ' lines (context).
To remove '%s' lines, delete them.
Lines starting with %s will be removed.
-\n"), $remove_minus, $remove_plus, $comment_line_char) .
-__($edit_hunk_manually_modes{$patch_mode}) ."\n". __(
+EOF
+__($edit_hunk_manually_modes{$patch_mode}),
# TRANSLATORS: 'it' refers to the patch mentioned in the previous messages.
-"If it does not apply cleanly, you will be given an opportunity to
+__ <<EOF2 ;
+If it does not apply cleanly, you will be given an opportunity to
edit again. If all lines of the hunk are removed, then the edit is
-aborted and the hunk is left unchanged.\n");
+aborted and the hunk is left unchanged.
+EOF2
close $fh;
chomp(my $editor = run_cmd_pipe(qw(git var GIT_EDITOR)));
diff --git a/git-send-email.perl b/git-send-email.perl
index bbeb9fb..068d60b 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -585,12 +585,13 @@ sub is_format_patch_arg {
if (defined($format_patch)) {
return $format_patch;
}
- die sprintf(__(
-"File '%s' exists but it could also be the range of commits
+ die sprintf(__ <<EOF, $f, $f);
+File '%s' exists but it could also be the range of commits
to produce patches for. Please disambiguate by...
- * Saying \"./%s\" if you mean a file; or
- * Giving --format-patch option if you mean a range."), $f, $f);
+ * Saying "./%s" if you mean a file; or
+ * Giving --format-patch option if you mean a range.
+EOF
} catch Git::Error::Command with {
# Not a valid revision. Treat it as a filename.
return 0;
@@ -654,7 +655,7 @@ sub get_patch_subject {
return "GIT: $1\n";
}
close $fh;
- die sprintf(__("No subject line in %s ?"), $fn);
+ die sprintf(__("No subject line in %s?"), $fn);
}
if ($compose) {
@@ -697,10 +698,10 @@ EOT3
}
open my $c2, ">", $compose_filename . ".final"
- or die sprintf(__("Failed to open %s.final : %s"), $compose_filename, $!);
+ or die sprintf(__("Failed to open %s.final: %s"), $compose_filename, $!);
open $c, "<", $compose_filename
- or die sprintf(__("Failed to open %s : %s"), $compose_filename, $!);
+ or die sprintf(__("Failed to open %s: %s"), $compose_filename, $!);
my $need_8bit_cte = file_has_nonascii($compose_filename);
my $in_body = 0;
@@ -1304,8 +1305,8 @@ Message-Id: $message_id
if ($needs_confirm eq "inform") {
$confirm_unconfigured = 0; # squelch this message for the rest of this run
$ask_default = "y"; # assume yes on EOF since user hasn't explicitly asked for confirmation
- print __(
-" The Cc list above has been expanded by additional
+ print __ <<EOF ;
+ The Cc list above has been expanded by additional
addresses found in the patch commit message. By default
send-email prompts before sending whenever this occurs.
This behavior is controlled by the sendemail.confirm
@@ -1313,7 +1314,9 @@ Message-Id: $message_id
For additional information, run 'git send-email --help'.
To retain the current behavior, but squelch this message,
- run 'git config --global sendemail.confirm auto'."), "\n\n";
+ run 'git config --global sendemail.confirm auto'.
+
+EOF
}
# TRANSLATORS: Make sure to include [y] [n] [q] [a] in your
# translation. The program will only accept English input
diff --git a/perl/Git.pm b/perl/Git.pm
index 17be59f..69cd1dd 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -1438,19 +1438,20 @@ sub END {
} # %TEMP_* Lexical Context
-=item prefix_lines ( PREFIX, STRING )
+=item prefix_lines ( PREFIX, STRING [, STRING... ])
Prefixes lines in C<STRING> with C<PREFIX>.
=cut
sub prefix_lines {
- my ($prefix, $string) = @_;
+ my $prefix = shift;
+ my $string = join("\n", @_);
$string =~ s/^/$prefix/mg;
return $string;
}
-=item comment_lines ( STRING )
+=item comment_lines ( STRING [, STRING... ])
Comments lines following core.commentchar configuration.
-- >8 --
--
2.11.0.rc0.33.gec17dab
next prev parent reply other threads:[~2016-11-11 12:46 UTC|newest]
Thread overview: 107+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-05 17:20 [PATCH v3 00/14] Mark strings in Perl scripts for translation Vasco Almeida
2016-10-05 17:20 ` [PATCH v3 01/14] i18n: add--interactive: mark strings " Vasco Almeida
2016-10-05 17:20 ` [PATCH v3 02/14] i18n: add--interactive: mark simple here-documents " Vasco Almeida
2016-10-05 17:20 ` [PATCH v3 03/14] i18n: add--interactive: mark strings with interpolation " Vasco Almeida
2016-10-05 22:28 ` Junio C Hamano
2016-10-05 17:21 ` [PATCH v3 04/14] i18n: clean.c: match string with git-add--interactive.perl Vasco Almeida
2016-10-05 17:21 ` [PATCH v3 05/14] i18n: add--interactive: mark plural strings Vasco Almeida
2016-10-05 22:41 ` Junio C Hamano
2016-10-05 17:21 ` [PATCH v3 06/14] i18n: add--interactive: mark patch prompt for translation Vasco Almeida
2016-10-05 17:21 ` [PATCH v3 07/14] i18n: add--interactive: i18n of help_patch_cmd Vasco Almeida
2016-10-05 17:21 ` [PATCH v3 08/14] i18n: add--interactive: mark edit_hunk_manually message for translation Vasco Almeida
2016-10-05 17:21 ` [PATCH v3 09/14] i18n: add--interactive: remove %patch_modes entries Vasco Almeida
2016-10-05 17:21 ` [PATCH v3 10/14] i18n: add--interactive: mark status words for translation Vasco Almeida
2016-10-05 17:21 ` [PATCH v3 11/14] i18n: send-email: mark strings " Vasco Almeida
2016-10-05 17:21 ` [PATCH v3 12/14] i18n: send-email: mark warnings and errors " Vasco Almeida
2016-10-05 17:21 ` [PATCH v3 13/14] i18n: send-email: mark string with interpolation " Vasco Almeida
2016-10-05 17:21 ` [PATCH v3 14/14] i18n: difftool: mark warnings " Vasco Almeida
2016-10-05 21:50 ` [PATCH v3 00/14] Mark strings in Perl scripts " Jakub Narębski
2016-10-10 12:54 ` [PATCH v4 " Vasco Almeida
2016-10-27 17:08 ` Junio C Hamano
2016-10-10 12:54 ` [PATCH v4 01/14] i18n: add--interactive: mark strings " Vasco Almeida
2016-10-19 18:14 ` Junio C Hamano
2016-10-20 16:21 ` Vasco Almeida
2016-10-20 16:25 ` Junio C Hamano
2016-10-10 12:54 ` [PATCH v4 02/14] i18n: add--interactive: mark simple here-documents " Vasco Almeida
2016-10-10 12:54 ` [PATCH v4 03/14] i18n: add--interactive: mark strings with interpolation " Vasco Almeida
2016-10-10 12:54 ` [PATCH v4 04/14] i18n: clean.c: match string with git-add--interactive.perl Vasco Almeida
2016-10-10 12:54 ` [PATCH v4 05/14] i18n: add--interactive: mark plural strings Vasco Almeida
2016-10-19 18:40 ` Junio C Hamano
2016-10-20 16:29 ` Vasco Almeida
2016-10-20 16:35 ` Vasco Almeida
2016-10-20 17:11 ` Junio C Hamano
2016-10-10 12:54 ` [PATCH v4 06/14] i18n: add--interactive: mark patch prompt for translation Vasco Almeida
2016-10-10 12:54 ` [PATCH v4 07/14] i18n: add--interactive: i18n of help_patch_cmd Vasco Almeida
2016-10-10 12:54 ` [PATCH v4 08/14] i18n: add--interactive: mark edit_hunk_manually message for translation Vasco Almeida
2016-11-07 16:04 ` Vasco Almeida
2016-10-10 12:54 ` [PATCH v4 09/14] i18n: add--interactive: remove %patch_modes entries Vasco Almeida
2016-10-10 12:54 ` [PATCH v4 10/14] i18n: add--interactive: mark status words for translation Vasco Almeida
2016-10-10 12:54 ` [PATCH v4 11/14] i18n: send-email: mark strings " Vasco Almeida
2016-10-10 12:54 ` [PATCH v4 12/14] i18n: send-email: mark warnings and errors " Vasco Almeida
2016-10-10 12:54 ` [PATCH v4 13/14] i18n: send-email: mark string with interpolation " Vasco Almeida
2016-10-10 12:54 ` [PATCH v4 14/14] i18n: difftool: mark warnings " Vasco Almeida
2016-11-08 12:08 ` [PATCH v5 00/16] Mark strings in Perl scripts " Vasco Almeida
2016-11-08 12:08 ` [PATCH v5 01/16] Git.pm: add subroutines for commenting lines Vasco Almeida
2016-11-09 1:06 ` Junio C Hamano
2016-11-09 17:02 ` Vasco Almeida
2016-11-09 22:25 ` Jakub Narębski
2016-11-09 23:16 ` Junio C Hamano
2016-11-08 12:08 ` [PATCH v5 02/16] i18n: add--interactive: mark strings for translation Vasco Almeida
2016-11-08 12:08 ` [PATCH v5 03/16] i18n: add--interactive: mark simple here-documents " Vasco Almeida
2016-11-08 12:08 ` [PATCH v5 04/16] i18n: add--interactive: mark strings with interpolation " Vasco Almeida
2016-11-08 12:08 ` [PATCH v5 05/16] i18n: clean.c: match string with git-add--interactive.perl Vasco Almeida
2016-11-08 12:08 ` [PATCH v5 06/16] i18n: add--interactive: mark plural strings Vasco Almeida
2016-11-08 12:08 ` [PATCH v5 07/16] i18n: add--interactive: mark patch prompt for translation Vasco Almeida
2016-11-08 12:08 ` [PATCH v5 08/16] i18n: add--interactive: i18n of help_patch_cmd Vasco Almeida
2016-11-08 12:08 ` [PATCH v5 09/16] i18n: add--interactive: mark edit_hunk_manually message for translation Vasco Almeida
2016-11-08 12:08 ` [PATCH v5 10/16] i18n: add--interactive: remove %patch_modes entries Vasco Almeida
2016-11-08 12:08 ` [PATCH v5 11/16] i18n: add--interactive: mark status words for translation Vasco Almeida
2016-11-08 12:08 ` [PATCH v5 12/16] i18n: send-email: mark strings " Vasco Almeida
2016-11-08 12:08 ` [PATCH v5 13/16] i18n: send-email: mark warnings and errors " Vasco Almeida
2016-11-08 12:08 ` [PATCH v5 14/16] i18n: send-email: mark string with interpolation " Vasco Almeida
2016-11-08 12:08 ` [PATCH v5 15/16] i18n: send-email: mark composing message " Vasco Almeida
2016-11-08 12:08 ` [PATCH v5 16/16] i18n: difftool: mark warnings " Vasco Almeida
2016-11-11 12:45 ` Vasco Almeida [this message]
2016-11-11 12:45 ` [PATCH v6 01/16] Git.pm: add subroutines for commenting lines Vasco Almeida
2016-11-22 14:10 ` Vasco Almeida
2016-11-22 17:42 ` Junio C Hamano
2016-12-09 17:19 ` Vasco Almeida
2016-12-09 17:32 ` Johannes Schindelin
2016-12-09 22:23 ` Junio C Hamano
2016-12-10 10:08 ` Vasco Almeida
2016-12-10 22:09 ` Junio C Hamano
2016-12-13 11:17 ` Vasco Almeida
2016-12-13 18:15 ` Junio C Hamano
2016-11-11 12:45 ` [PATCH v6 02/16] i18n: add--interactive: mark strings for translation Vasco Almeida
2016-11-11 12:45 ` [PATCH v6 03/16] i18n: add--interactive: mark simple here-documents " Vasco Almeida
2016-11-11 12:45 ` [PATCH v6 04/16] i18n: add--interactive: mark strings with interpolation " Vasco Almeida
2016-11-11 12:45 ` [PATCH v6 05/16] i18n: clean.c: match string with git-add--interactive.perl Vasco Almeida
2016-11-11 12:45 ` [PATCH v6 06/16] i18n: add--interactive: mark plural strings Vasco Almeida
2016-11-11 12:45 ` [PATCH v6 07/16] i18n: add--interactive: mark patch prompt for translation Vasco Almeida
2016-11-11 12:45 ` [PATCH v6 08/16] i18n: add--interactive: i18n of help_patch_cmd Vasco Almeida
2016-11-11 12:45 ` [PATCH v6 09/16] i18n: add--interactive: mark edit_hunk_manually message for translation Vasco Almeida
2016-11-11 12:45 ` [PATCH v6 10/16] i18n: add--interactive: remove %patch_modes entries Vasco Almeida
2016-11-11 12:45 ` [PATCH v6 11/16] i18n: add--interactive: mark status words for translation Vasco Almeida
2016-11-11 12:45 ` [PATCH v6 12/16] i18n: send-email: mark strings " Vasco Almeida
2016-11-11 12:45 ` [PATCH v6 13/16] i18n: send-email: mark warnings and errors " Vasco Almeida
2016-11-11 12:45 ` [PATCH v6 14/16] i18n: send-email: mark string with interpolation " Vasco Almeida
2016-11-11 12:45 ` [PATCH v6 15/16] i18n: send-email: mark composing message " Vasco Almeida
2016-11-11 12:45 ` [PATCH v6 16/16] i18n: difftool: mark warnings " Vasco Almeida
2016-12-14 12:54 ` [PATCH v7 00/16] Mark strings in Perl scripts " Vasco Almeida
2016-12-14 19:02 ` Junio C Hamano
2016-12-14 12:54 ` [PATCH v7 01/16] Git.pm: add subroutines for commenting lines Vasco Almeida
2016-12-14 12:54 ` [PATCH v7 02/16] i18n: add--interactive: mark strings for translation Vasco Almeida
2016-12-14 12:54 ` [PATCH v7 03/16] i18n: add--interactive: mark simple here-documents " Vasco Almeida
2016-12-14 12:54 ` [PATCH v7 04/16] i18n: add--interactive: mark strings with interpolation " Vasco Almeida
2016-12-14 12:54 ` [PATCH v7 05/16] i18n: clean.c: match string with git-add--interactive.perl Vasco Almeida
2016-12-14 12:54 ` [PATCH v7 06/16] i18n: add--interactive: mark plural strings Vasco Almeida
2016-12-14 12:54 ` [PATCH v7 07/16] i18n: add--interactive: mark patch prompt for translation Vasco Almeida
2016-12-14 12:54 ` [PATCH v7 08/16] i18n: add--interactive: i18n of help_patch_cmd Vasco Almeida
2016-12-14 12:54 ` [PATCH v7 09/16] i18n: add--interactive: mark edit_hunk_manually message for translation Vasco Almeida
2016-12-14 12:54 ` [PATCH v7 10/16] i18n: add--interactive: remove %patch_modes entries Vasco Almeida
2016-12-14 12:54 ` [PATCH v7 11/16] i18n: add--interactive: mark status words for translation Vasco Almeida
2016-12-14 12:54 ` [PATCH v7 12/16] i18n: send-email: mark strings " Vasco Almeida
2016-12-14 12:54 ` [PATCH v7 13/16] i18n: send-email: mark warnings and errors " Vasco Almeida
2016-12-14 12:54 ` [PATCH v7 14/16] i18n: send-email: mark string with interpolation " Vasco Almeida
2016-12-14 12:54 ` [PATCH v7 15/16] i18n: send-email: mark composing message " Vasco Almeida
2016-12-14 12:54 ` [PATCH v7 16/16] i18n: difftool: mark warnings " Vasco Almeida
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161111124541.8216-1-vascomalmeida@sapo.pt \
--to=vascomalmeida@sapo.pt \
--cc=avarab@gmail.com \
--cc=davvid@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jn.avila@free.fr \
--cc=jnareb@gmail.com \
--cc=worldhello.net@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).