views:

40

answers:

1

Hi,

I have installed the dutch local (nl_NL utf8) on my webserver (when I execute locale -a I see nl_NL utf8 so this is allright).

However, the dates on my webpage are in english (I have put setlocale(LC_ALL, 'nl_NL'); in the top of my pages). I have read when you install a locale package after compiling php, I have to recompile php.

But is there any other solution, without recompiling php, to let it work?

Thanks!

A: 

This may be by design: setlocale() does not automatically change the output of the format of dates output using date() and strftime(). What it does is localize the weekday and month names, but nothing else.

Can you show some examples of how you output dates, and how they fail to get converted?

Pekka
I'm using Smarty (ie: {$memberdate|date_format:"%A, %d %B %Y"}), but I have used the same code on another webserver without any problems (the locale files were already installed before compiling php).
Arjen
@Arjen ah, I see. Then my answer doesn't sort it. That adding a locale requires *reinstalling* PHP sounds a little odd to me, though: Is that official info?
Pekka
See http://www.php.net/manual/en/function.setlocale.php#86246
Arjen
@Arjen hmmmmm, strange. Sounds a bit over the top to me. I'm sure you have restarted the machine after installing the package? (just asking to exclude the possibility.)
Pekka
Yes I have restarted the whole machine.
Arjen