Re: [PATCH v2 01/11] i18n: add--interactive: mark strings for translation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Vasco Almeida <vascomalmeida@xxxxxxx> writes:

> Mark simple strings (without interpolation) for translation.
>
> Brackets around first parameter of ternary operator is necessary because
> otherwise xgettext fails to extract strings marked for translation from
> the rest of the file.
>
> Signed-off-by: Vasco Almeida <vascomalmeida@xxxxxxx>
> ---
>  git-add--interactive.perl | 68 +++++++++++++++++++++++++----------------------
>  1 file changed, 36 insertions(+), 32 deletions(-)
>
> diff --git a/git-add--interactive.perl b/git-add--interactive.perl
> index 822f857..fb8e5de 100755
> --- a/git-add--interactive.perl
> +++ b/git-add--interactive.perl
> @@ -4,6 +4,7 @@ use 5.008;
>  use strict;
>  use warnings;
>  use Git;
> +use Git::I18N;
>  
>  binmode(STDOUT, ":raw");
>  
> @@ -252,7 +253,7 @@ sub list_untracked {
>  }
>  
>  my $status_fmt = '%12s %12s %s';
> -my $status_head = sprintf($status_fmt, 'staged', 'unstaged', 'path');
> +my $status_head = sprintf($status_fmt, __('staged'), __('unstaged'), __('path'));

Wouldn't it make sense to allow translators to tweak $status_fmt if
you are allowing the earlier elements that are formatted with %12s,
as their translation may not fit within that width, in which case
they may want to make these columns wider?

>  			prompt_yesno(
> -				'Your edited hunk does not apply. Edit again '
> -				. '(saying "no" discards!) [y/n]? '
> +				# TRANSLATORS: do not translate [y/n]
> +				# The program will only accept that input
> +				# at this point.
> +				__('Your edited hunk does not apply. Edit again '
> +				   . '(saying "no" discards!) [y/n]? ')

Not just [y/n], but "no" in "saying no discards!" also needs to
stay, no?  I wonder if it is a good idea to lose the TRANSLATORS
comment by ejecting "[y/n]" outside the "__()" construct here.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]