Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
setlocale in gsconfig.php - date is not correct
#1
GetSimple does not take settings from the variable setlocale in gsconfig.php (e.g. cs_CZ, Czech) - the date is still written in English. See attachment.
What should I do?
Reply
#2
I see that you test it on local webserver.
Is your webserver configured correctly to operate with setlocale (does it contain CZ)?
Screenie you posted shows date of added page in plain GS, or is it a content posted using an additional plugin ?

I'd firstly try to look how does it work on my hosting provider's server.


ps. try to use strftime with your own date display setting.
Addons: blue business theme, Online Visitors, Notepad
Reply
#3
yojoe Wrote:I see that you test it on local webserver.
Is your webserver configured correctly to operate with setlocale (does it contain CZ)?
Other specific function Czech display is right.
yojoe Wrote:Screenie you posted shows date of added page in plain GS, or is it a content posted using an additional plugin ?
Both - plain GS (date of entry) and plugin (Calendar - Events).
yojoe Wrote:I'd firstly try to look how does it work on my hosting provider's server.
Not working - same as the local webserver.
yojoe Wrote:ps. try to use strftime with your own date display setting.
I do not understand...

P.S. maybe the error is in the date_default_timezone_set?
Reply
#4
Hello,
the only way I got the correct date was with the plugin: http://get-simple.info/forum/post/4414/#p4414

Only translate the array to you lang.

Regards.
Reply
#5
JP Wrote:
yojoe Wrote:ps. try to use strftime with your own date display setting.
I do not understand...

P.S. maybe the error is in the date_default_timezone_set?

K, I've managed to get it working after lotsa time :\

Set your timezone in GM options (admin panel), and add your timezone to .htaccess (to be sure)
Code:
SetEnv TZ Europe/Prague
(you can find other timezones under http://www.php.net/manual/en/timezones.php)

Next thing is to change default timezone in admin/inc/common.php line 74

Now the whole trick. I've mentioned about strftime function, as it's used to format the date to specific locale settings. GS uses strtotime function, which is capable of showing date only in US date format.

Locate admin/inc/theme_functions.php file, and find function get_page_date
Inside change (delete or comment)
Code:
echo date($i, strtotime($date));
to
Code:
echo iconv("", "UTF-8",strftime('%A, %e.%B. %Y'));
If you use ISO format istead of UTF, change it in above's line.

That should do it. I prepared the date as you have shown on img included in 1st post.
You may also change first line of this function to
Code:
function get_page_date($i = "l, j.m.Y - H:i")
because you don't use 12hours format.

Let me know if it worked.
I'll try to report this "bug".
Addons: blue business theme, Online Visitors, Notepad
Reply




Users browsing this thread: 1 Guest(s)