In my guest post on Arvixe Blog named "Creating a Multilingual CMSMS Site using MleCMS module" i have mentioned a UDT to override locale settings of our Pages named "set_locale".
Since release of MleCMS module 1.10.5, the option for setlocale has been included as per my Feature Request as well as setting for Language Direction, again a big thanks to Zdeno Kuzmany for quick response.
The problem with setlocale you might encouter is, that not all Server are setup the same so in some cases you will have to find out a proper setting.
You can check that on a UNIX based Server very quickly by running a simple UDT in CMSMS Backend.
To create the UDT simply go to "Extensions » User Defined Tags" and add following simple oneliner code, you can name it however you like, for example "check_locale".
system('locale -a'); Now to run this UDT from backend simply go back to "User Defined Tags" interface in backend and click on "Run this User Defined Tag" icon.
You will see a interface with textarea containg your PHP code and at the bottom of it a button "Run", click on that button and see the output.
In the output you will see a list of all available locale settings on your Server.
Hi Goran,
first - i'd like to thank you for really helpful article(s)
second - i confirm problem described by NikNak. when using {set_locale} UDT in cmsms 1.10.3 i'm also getting:
Fatal error: Cannot access protected property Content::$mHierarchyPath in lib/classes/class.usertagoperations.inc.php(260) : eval()'d code on line 6
I had to configure the locale for a dutch website. This article helped a bit thank you.
Besides checking the locale it's wise to verify if the locale works in your UDT you can do something like this:
setlocale(LC_ALL, 'nl_NL.UTF-8'); /* Output: vrijdag 22 december 1978 */ echo strftime("%A %e %B %Y", mktime(0, 0, 0, 12, 22, 1978));
Also don't forget to set the "Date Format String:" under /admin -> Site Admin -> Global Settings -> [General Settings]-tab.
Now {$output_a_date|cms_date_format} works smootly.
Hi NikNak,
thank you, i will check the UDT when i get some time for it. But regarding MleCMS, did you set a locale in the config.php? if yes remove that.
Hi Goran
Thanks for the article.
Sadly I couldn't get the 1.10.5 version of mleCMS to actually change the locale on my pages. {get_page_vars} gives lang = en_US every time (though lang_locale = de_DE also shows from mleCMS). Even though I was following your instructions - and those in the mleCMS forge request page.
So I tried the UDT but the UDT will not work with the latest install of cmsms - it throws an error: Cannot access protected property Content::$mHierarchyPath
Just thought I'd let you know.
Kind regards
Nik