From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-5.4 required=3.0 tests=AWL,BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 992E52035F for ; Fri, 11 Nov 2016 12:46:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756584AbcKKMqB (ORCPT ); Fri, 11 Nov 2016 07:46:01 -0500 Received: from relay5.ptmail.sapo.pt ([212.55.154.25]:48559 "EHLO sapo.pt" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756575AbcKKMqA (ORCPT ); Fri, 11 Nov 2016 07:46:00 -0500 Received: (qmail 736 invoked from network); 11 Nov 2016 12:45:58 -0000 Received: (qmail 3336 invoked from network); 11 Nov 2016 12:45:58 -0000 Received: from unknown (HELO catarina.localdomain) (vascomalmeida@sapo.pt@[85.246.157.91]) (envelope-sender ) by ptmail-mta-auth01 (qmail-ptmail-1.0.0) with ESMTPA for ; 11 Nov 2016 12:45:58 -0000 X-PTMail-RemoteIP: 85.246.157.91 X-PTMail-AllowedSender-Action: X-PTMail-Service: default From: Vasco Almeida To: git@vger.kernel.org Cc: Vasco Almeida , Jiang Xin , =?UTF-8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= , =?UTF-8?q?Jean-No=C3=ABl=20AVILA?= , =?UTF-8?q?Jakub=20Nar=C4=99bski?= , David Aguilar , Junio C Hamano Subject: [PATCH v6 09/16] i18n: add--interactive: mark edit_hunk_manually message for translation Date: Fri, 11 Nov 2016 11:45:34 -0100 Message-Id: <20161111124541.8216-10-vascomalmeida@sapo.pt> X-Mailer: git-send-email 2.11.0.rc0.33.gec17dab In-Reply-To: <20161111124541.8216-1-vascomalmeida@sapo.pt> References: <20161111124541.8216-1-vascomalmeida@sapo.pt> In-Reply-To: <20161005172110.30801-1-vascomalmeida@sapo.pt> References: <20161005172110.30801-1-vascomalmeida@sapo.pt> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Mark message of edit_hunk_manually displayed in the editing file when user chooses 'e' option. The message had to be unfolded to allow translation of the $participle verb. Some messages end up being exactly the same for some use cases, but left it for easier change in the future, e.g., wanting to change wording of one particular use case. The comment character is now used according to the git configuration core.commentchar. Signed-off-by: Vasco Almeida --- git-add--interactive.perl | 52 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/git-add--interactive.perl b/git-add--interactive.perl index 045b847cf..7d1cc5652 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -1058,6 +1058,30 @@ sub color_diff { } @_; } +my %edit_hunk_manually_modes = ( + stage => N__( +"If the patch applies cleanly, the edited hunk will immediately be +marked for staging."), + stash => N__( +"If the patch applies cleanly, the edited hunk will immediately be +marked for stashing."), + reset_head => N__( +"If the patch applies cleanly, the edited hunk will immediately be +marked for unstaging."), + reset_nothead => N__( +"If the patch applies cleanly, the edited hunk will immediately be +marked for applying."), + checkout_index => N__( +"If the patch applies cleanly, the edited hunk will immediately be +marked for discarding"), + checkout_head => N__( +"If the patch applies cleanly, the edited hunk will immediately be +marked for discarding."), + checkout_nothead => N__( +"If the patch applies cleanly, the edited hunk will immediately be +marked for applying."), +); + sub edit_hunk_manually { my ($oldtext) = @_; @@ -1065,22 +1089,24 @@ sub edit_hunk_manually { my $fh; open $fh, '>', $hunkfile or die sprintf(__("failed to open hunk edit file for writing: %s"), $!); - print $fh "# 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 $participle = $patch_mode_flavour{PARTICIPLE}; my $is_reverse = $patch_mode_flavour{IS_REVERSE}; my ($remove_plus, $remove_minus) = $is_reverse ? ('-', '+') : ('+', '-'); - print $fh <; + my @newtext = grep { !/^$comment_line_char/ } <$fh>; close $fh; unlink $hunkfile; -- 2.11.0.rc0.33.gec17dab