Re: [PATCH v2 05/11] i18n: add--interactive: mark message for translation

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

 



A Sáb, 01-10-2016 às 19:09 +0200, Jakub Narębski escreveu:
> W dniu 26.09.2016 o 01:09, Junio C Hamano pisze:
> > Vasco Almeida <vascomalmeida@xxxxxxx> writes:
>
> >> -            print colored $prompt_color,
> $patch_mode_flavour{VERB},
> >> -              ($hunk[$ix]{TYPE} eq 'mode' ? ' mode change' :
> >> -               $hunk[$ix]{TYPE} eq 'deletion' ? ' deletion' :
> >> -               ' this hunk'),
> >> -              $patch_mode_flavour{TARGET},
> >> -              " [y,n,q,a,d,/$other,?]? ";
>
> > I hate to say this but expanding this single-liner into if/elsif/
> > cascade of uncountable number of arms is simply a disaster.
> 
> Even if we turn this "single"-liner composition of sentence into
> interpolation (allowing for reordering of parts in translation),
> like
> 
>    print colored $prompt_color, __x("{verb} {noun}{maybe_target}
> [y,n,q,a,d,/{other},?]? ",
>         verb => $patch_mode_flavour{VERB}, noun =>
> $patch_mode_noun{$hunk[$ix]{TYPE}},
>         maybe_target => $patch_mode_flavour{TARGET} || "", other =>
> $other);
> 
> This would of course require N__() on values of hash, somewhere.
> 
> the problem is that the ordering may need to change depending on
> verb: "Stage", "Stash", "Unstage", "Apply", "Discard", and/or noun:
> "mode change", "deletion", "this hunk", and/or presence and value
> of maybe_target: " to index", " from worktree", " from index and
> worktree",
> " to index and worktree".

So it does not work, unfortunately. The plus side is it would be very
concise compared to laying every combination as entire sentences.
However, if it worked, I think it would be a bit difficult to translate
and translators would be prone to commit some mistake somewhere. It may
be harder to translate a sentence by its bits than translate it as a
whole.



[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]