[Solved] Locale problems - partly solved

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
christiaans
Power Poster
Power Poster
Posts: 300
Joined: Tue Mar 04, 2008 10:37 am

[Solved] Locale problems - partly solved

Post 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!
Last edited by christiaans on Thu Jan 08, 2009 4:48 pm, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

Re: Locale problems

Post by RonnyK »

Did you try setting the dateformat in the GlobalSettings. Or are you talking about the name of the month.....

Ronny
christiaans
Power Poster
Power Poster
Posts: 300
Joined: Tue Mar 04, 2008 10:37 am

Re: Locale problems

Post 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)...
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Locale problems

Post by Dr.CSS »

Have you set the lang. any where...
JayDee
Forum Members
Forum Members
Posts: 13
Joined: Tue Oct 09, 2007 4:21 pm

Re: Locale problems

Post 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.
christiaans
Power Poster
Power Poster
Posts: 300
Joined: Tue Mar 04, 2008 10:37 am

Re: Locale problems

Post 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 :).
christiaans
Power Poster
Power Poster
Posts: 300
Joined: Tue Mar 04, 2008 10:37 am

Re: Locale problems

Post 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!
Last edited by christiaans on Thu Jan 08, 2009 12:22 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Locale problems

Post by Dr.CSS »

Have you tried nl-NL?...
christiaans
Power Poster
Power Poster
Posts: 300
Joined: Tue Mar 04, 2008 10:37 am

Re: Locale problems

Post 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..?
Last edited by christiaans on Thu Jan 08, 2009 9:33 am, edited 1 time in total.
christiaans
Power Poster
Power Poster
Posts: 300
Joined: Tue Mar 04, 2008 10:37 am

Re: Locale problems

Post 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..
per
Forum Members
Forum Members
Posts: 59
Joined: Tue Apr 08, 2008 4:09 pm

Re: Locale problems

Post 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.
Last edited by per on Thu Jan 08, 2009 12:40 pm, edited 1 time in total.
christiaans
Power Poster
Power Poster
Posts: 300
Joined: Tue Mar 04, 2008 10:37 am

Re: Locale problems

Post by christiaans »

Hmm, sadly that doesn't work for me (as stated).. I think I'll be doomed to use the UDT..  :'(
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: [Solved] Locale problems - partly solved

Post by Dr.CSS »

Are you trying to get every page to show this way? if so why not put UDT in the template/s...
christiaans
Power Poster
Power Poster
Posts: 300
Joined: Tue Mar 04, 2008 10:37 am

Re: [Solved] Locale problems - partly solved

Post 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 :)..
JayDee
Forum Members
Forum Members
Posts: 13
Joined: Tue Oct 09, 2007 4:21 pm

Re: [Solved] Locale problems - partly solved

Post 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");
Post Reply

Return to “CMSMS Core”