Two standard libraries?
Sean Kelly
sean at f4.ca
Mon Jul 16 08:20:38 PDT 2007
Roberto Mariottini wrote:
> Jarrett Billingsley wrote:
> [...]
>> Now look at a language like Japanese, where you'd probably put the
>> database name first; it'd be arranged something like "in personnel
>> database {}, employee {} does not exist". Now you have to change the
>> order of the arguments after the format string. But with indexing,
>> you can say {0} always is the employee name, and {1} always is the
>> database name, so that you can format them in the correct order for
>> other languages, without having to change the actual format code.
>> Just change the format string.
>
> May I suggest to use an identifier instead of a numeric index?
> I have several years of experience with multi-language code and I can
> say that for a translator is better.
>
> For example:
>
> "{0} has {1} pieces in {2}"
>
> Could be:
>
> "{supplier} has {stock} pieces in {city}"
>
> and make the translator happy.
How would such identifiers be matched up with variadic arguments?
Sean
More information about the Digitalmars-d
mailing list