> On 2013-05-04, at 13:15 , Olivier Renaud wrote:
> > Gettext is indeed dependent on the fact that the format syntax allows
> > positional parameters.
> Not really, since gettext does not do formatting it does not care and
> because different languages may need to reorder parameters it's usually
> better to have either named or explicitly indexable parameters

Granted, I should have said "gettext is dependent on the fact that the format 
syntax allows parameters reordering". This is precisely because, as you said,  
gettext does not do formatting on its own.


> Gettext pluralization takes specific count arguments to handle dispatching
> between multiple forms, but that's orthogonal to formatting as this
> example from the documentation shows:
> 
>     puts (ngettext ("Delete the selected file?",
>                     "Delete the selected files?",
>                     n));

What you say is true, but I'm afraid I don't see the relation with the current 
discussion.
 
> > I'd like to point out that gettext also makes use of a "feature" of the
> > formatting function.
> It's not gettext doing that either, since gettext doesn't do any
> formatting. It can be a useful feature when paired with gettext as
> translations may or may not need all original format arguments, but it's
> orthogonal to gettext's behavior and features.

Again, you are right. Gettext will do its job happily, no matter what the 
content of the string is. The problem is for the translator :

- If the format string provided by the language doesn't support parameters 
reordering, then the translator is forced to produce a translation where the 
parameters appear in the same order than in english
- if the formatting function provided by the language doesn't support a way to 
ignore certain parameters, then the translator is forced to use all parameters 
to produce its translation.
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to