std.locale

Georg Wrede georg.wrede at iki.fi
Sun Mar 1 19:40:03 PST 2009


Walter Bright wrote:
> Andrei Alexandrescu wrote:
>> There will be a global reference to a Locale class, e.g. 
>> defaultLocale. By default the reference will be null, implying the C 
>> locale should be in effect. Applications can assign to it as they find 
>> fit, and also pass around multiple locale variables.
> 
> I disagree with being able to assign to the global defaultLocale. This 
> is going to cause endless problems. Just one is that any function that 
> uses locale can no longer be pure. defaultLocale should be immutable.

The two programs that are most "locale aware" are usually spread sheets 
and word processors.

It is usual that the user needs to write, say, in Swedish or in Russian, 
while in a Finnish setting. Or that one wants to use a decimal separator 
other than what is "proper" for the country.

For example, a lot of people use "." instead of the official "," in 
Finland, and many use time as "18:23" instead of "18.23".


For this purpose, these programs let the users define these any way they 
want.

I think the notion of locales is, slowly but steadily, going away.

It was a nice idea at the time, but with two problems: users don't use 
it, and programmers don't use it.


Of course, eventually we will want to "do something" about this. But 
that should be left to the day when real issues are all sorted out in D. 
This is a non-urgent, low-priority thing.



More information about the Digitalmars-d mailing list