From: Vasco Almeida Date: Wed, 05 Oct 2016 17:21:04 GMT Subject: [PATCH v3 08/14] i18n: add--interactive: mark edit_hunk_manually message for translation Message-ID: <20161005172110.30801-9-vascomalmeida@sapo.pt> In-Reply-To: <20161005172110.30801-1-vascomalmeida@sapo.pt> 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 uses cases, but left it for easier change in the future, e.g., wanting to change wording of one particular use case. Signed-off-by: Vasco Almeida --- git-add--interactive.perl | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/git-add--interactive.perl b/git-add--interactive.perl index 35967fe..5356d5a 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -1058,6 +1058,30 @@ sub color_diff { } @_; } +my %edit_hunk_manually_modes = ( + stage => __( +"# If the patch applies cleanly, the edited hunk will immediately be +# marked for staging."), + stash => __( +"# If the patch applies cleanly, the edited hunk will immediately be +# marked for stashing."), + reset_head => __( +"# If the patch applies cleanly, the edited hunk will immediately be +# marked for unstaging."), + reset_nothead => __( +"# If the patch applies cleanly, the edited hunk will immediately be +# marked for applying."), + checkout_index => __( +"# If the patch applies cleanly, the edited hunk will immediately be +# marked for discarding"), + checkout_head => __( +"# If the patch applies cleanly, the edited hunk will immediately be +# marked for discarding."), + checkout_nothead => __( +"# If the patch applies cleanly, the edited hunk will immediately be +# marked for applying."), +); + sub edit_hunk_manually { my ($oldtext) = @_; @@ -1065,22 +1089,21 @@ 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 __("# 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 <