Re: [PATCH v2 05/11] i18n: add--interactive: mark message for translation
- From
Vasco Almeida <vascomalmeida@sapo.pt>
- Date
- Oct 3, 2016, 12:49 UTC
- Message-ID
- <1475498965.1776.23.camel@sapo.pt>
- In-Reply-To
- <32b8c9ed-82df-0d71-a610-064b6ebf7a4e@gmail.com>
A Sáb, 01-10-2016 às 19:09 +0200, Jakub Narębski escreveu:
Show 33 quoted lines
> W dniu 26.09.2016 o 01:09, Junio C Hamano pisze:
> > Vasco Almeida <vascomalmeida@sapo.pt> 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.