|
From: Jeff D. <da...@da...> - 2001-03-14 23:18:06
|
In message <3AA...@x-...>,Reini Urban writes:
>> Is there a reason we shouldn't switch to using
>> strftime rather than date everywhere?
>>
>> >setlocale("LC_TIME", "german");
>
>yes, there is.
>I couldn't figure out which locale on which platform is best, or just works.
>at least for german :)
Uh oh. I was afraid of that.
>LC_TYPE "german" works for me on win2000 and linux now,
>but the recommended settings ("de_GE" or "de_AT") do not work as they should.
> (austrians need different sublocales for weekday and month names for
>example)
'de_GE' (probably a typo?) is incorrect, I think. Should be 'de_DE'?
Datapoint: I've tested 'de_DE' and 'de_AT', and 'german' on four Linux
systems. They all seem to work (at least they do something) on all of them.
The systems were:
RedHat 7.0, glibc 2.2
RedHat 6.2, glibc-2.1
RedHat 5.2, glibc-2.1
Debian 2.2?, glibc 2.1
Plain 'de' does not work on any of those systems. I though it should,
but perhaps I'm wrong.
(A simple way to test, at least on unix systems, is from the command
line, e.g.:)
LANG=de_DE date "+%x"
Which should print the date in the locale-specific format.
That said, even if you can't find the correct locale setting, does
switching from date() to strftime() break anything? With date()
you're stuck with English days/months no matter what --- with strftime()
you have a chance of getting dates in your native language.
Jeff
|