Page 1 of 1

[Solved] Locale problems - partly solved

Posted: Tue Jan 06, 2009 7:52 pm
by christiaans
Hey guys,

I'm running into a locale problem.

Using the latest (1.5.1) CMSMS, and some modules (which don't influence the locale settings), I am not able to get the locale correct. I even tried setting the locale in config.php, but it still doesn't work.

So all the dates show up in English, instead of Dutch. And I can't seem to find the problem, and it really annoys me, since it needs to be Dutch, because the site is completely Dutch.

Anyone familiar with the problems or know a workaround?

P.S. I already tried using a UDT with setlocale, but that doesn't work either!

Re: Locale problems

Posted: Tue Jan 06, 2009 8:41 pm
by RonnyK
Did you try setting the dateformat in the GlobalSettings. Or are you talking about the name of the month.....

Ronny

Re: Locale problems

Posted: Tue Jan 06, 2009 9:34 pm
by christiaans
I am indeed talking about the name of the month and weekday (I want it to be: Maandag 5 januari 2009, but instead it outputs: Monday 5 january 2009)...

Re: Locale problems

Posted: Wed Jan 07, 2009 3:15 am
by Dr.CSS
Have you set the lang. any where...

Re: Locale problems

Posted: Wed Jan 07, 2009 1:50 pm
by JayDee
What hosting are you using? Are you using a dutch or english host? Foreign hosts may not always have all locales installed on their systems. I found my server having the same problems until I installed more locales.

If you have control over the server, ssh login and do a sudo dpkg-reconfigure locales and select dutch (or any other cmsms supported language) from the list. If not, beg at your host.

Re: Locale problems

Posted: Wed Jan 07, 2009 3:45 pm
by christiaans
I never changed anything within cmsms. However, I think I will set up another test, and let you guys know..

thanks for the tip JD :).

Re: Locale problems

Posted: Wed Jan 07, 2009 8:40 pm
by christiaans
Hey guys, so now I set up a testsite, and it still doesn't work. I am now; however, a bit confused how the "locale" variable in the config.php needs to be defined..?

I tried using: nl_NL or nl, both didn't work.

P.S. You can find the date string below the searchbox!

Re: Locale problems

Posted: Wed Jan 07, 2009 10:34 pm
by Dr.CSS
Have you tried nl-NL?...

Re: Locale problems

Posted: Thu Jan 08, 2009 9:29 am
by christiaans
Yep, and it doesn't work either.. How is this possible, is my host overriding cmsms or something??

update: I tried testing with a UDT with the following:

Code: Select all

setlocale(LC_TIME, "C");
echo strftime("%A");
setlocale(LC_TIME, "fi_FI");
echo strftime(" in Finnish is %A,");
setlocale(LC_TIME, "fr_FR");
echo strftime(" in French %A and");
setlocale(LC_TIME, "de_DE");
echo strftime(" in German %A.\n");
And it just displays:
Thursday in Finnish is Thursday, in French Thursday and in German Thursday.
So it seems my host overrides all locale settings or so..?

Re: Locale problems

Posted: Thu Jan 08, 2009 9:43 am
by christiaans
Okay, so I visited the forum of my hosting company, and it turns out you need to use: nl_NL.UTF-8..

However, if I fill that in in the config file, it still doesn't work. I made a UDT with setlocale, and that works, but now I have to remember to insert the UDT everywhere in the pages..

Re: Locale problems

Posted: Thu Jan 08, 2009 12:35 pm
by per
i had the same problem.
I have put es_ES in the locate field in config.php and the date changed to spanish.

Re: Locale problems

Posted: Thu Jan 08, 2009 4:23 pm
by christiaans
Hmm, sadly that doesn't work for me (as stated).. I think I'll be doomed to use the UDT..  :'(

Re: [Solved] Locale problems - partly solved

Posted: Thu Jan 08, 2009 5:18 pm
by Dr.CSS
Are you trying to get every page to show this way? if so why not put UDT in the template/s...

Re: [Solved] Locale problems - partly solved

Posted: Thu Jan 08, 2009 5:25 pm
by christiaans
mark wrote: Are you trying to get every page to show this way? if so why not put UDT in the template/s...
That is what I am doing now. However, I have a X number of templates, and if I add a new template, I have to remember to insert the UDT, so it's something extra. But it works, so it's all good :)..

Re: [Solved] Locale problems - partly solved

Posted: Mon Jan 19, 2009 10:48 am
by JayDee
You might want to try this little hack. Put this somewhere on your index.php (line 35 seems like a suitable place)

Code: Select all

setlocale(LC_ALL, "nl_NL.UTF8");