Re: [PATCH v2 02/11] i18n: add--interactive: mark simple here documents for translation
- From
Jakub Narębski <jnareb@gmail.com>
- Date
- Sep 30, 2016, 17:26 UTC
- Message-ID
- <e71c5040-8fed-887b-bf35-af4ae28d469f@gmail.com>
- In-Reply-To
- <1472646690-9699-3-git-send-email-vascomalmeida@sapo.pt>
W dniu 31.08.2016 o 14:31, Vasco Almeida pisze:
Show 8 quoted lines
> Mark messages in here document without interpolation for translation. > > Marking for translation by removing here documents this way, rather than > take advantage of "print __ << EOF" way, makes other instances of help > messages in clean.c match the first two in this file. Otherwise, > reusing here document would add a trailer newline to the message, making > them not match 100%, hence creating two entries in pot template for > translation rather than a single entry.
This is good catch, but I think it goes backwards with the solution.
If the text to be translated is multi-line, and it must end with newline, why is this final newline not included in the msgid? This would involve turning printf_ln into printf, and adding trailing newline in final entry for builtin/clean.c:295, etc. - I think it is better solution than uglyifing git-add--interactive.perl
Though it is not much of uglifying thanks to Perl support for embedded newlines in double-quoted strings.
Show 25 quoted lines
>
> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
> ---
> git-add--interactive.perl | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/git-add--interactive.perl b/git-add--interactive.perl
> index fb8e5de..e11a33d 100755
> --- a/git-add--interactive.perl
> +++ b/git-add--interactive.perl
> @@ -636,25 +636,25 @@ sub list_and_choose {
> }
>
> sub singleton_prompt_help_cmd {
> - print colored $help_color, <<\EOF ;
> -Prompt help:
> + print colored $help_color, __(
> +"Prompt help:
> 1 - select a numbered item
> foo - select item based on unique prefix
> - - (empty) select nothing
> -EOF
> + - (empty) select nothing"),
> +"\n";
> }[... enough for information ...]
Regards,
-- Jakub Narębski