D Conference Tango Phobos

renoX renosky at free.fr
Sat Sep 15 02:21:22 PDT 2007


Janice Caron a écrit :
> On 9/15/07, renoX <renosky at free.fr> wrote:
>> Somehow I don't see that requiring me to count where my arguments are as
>> a progress for me.
> 
> It is a very important feature which is /required/ for
> internationalisation. If you haven't noticed this, it's because you
> only write programs for an English-speaking audience.
> (Internationalisation would require a thread all to itself).

Well you didn't look at my solution.

I agree that different translations must be able to put the variable in 
the order they want, but my solution is to put the variable name inside 
the format string which is much better than counting.

So instead of having "Prenom {0}, Nom {1}", firsname, name" you would 
have "Prenom %{firstname} Name %{name}".

Unfortunately, unless you want to use mixin, this requires macro, so 
it's not useable yet, plus the interaction with a localisation tool and 
a compiler is not clear to me yet, but I hope that you agree that the 
result would be much more readable.

> I'm not a Tango user, but I do understand the need for this.

As said above, I also understand the need but I disagree with the solution.

renoX
> 
> (That's not to say you can't do internationalisation without Tango -
> you just have to write a parameter reordering function manually).



More information about the Digitalmars-d mailing list