Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 10:42 am EST

Geeklog Forums

How to change language of time and date


Status: offline

deepak1155

Forum User
Chatty
Registered: 01/15/08
Posts: 35
Hi to all
I am using geeklog 1.4.1. I want to display time and date in other language but i can't able to do that. Please help me.
Thanks
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 08/29/05
Posts: 985
The text for months and days should be in your language files: $LANG_MONTH and $LANG_WEEK.

That said, there are many places in the code where the builtin strftime function is called and that function depends on your locale setting. What is your $_CONF['locale'] set to in config.php?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
:rtfm: How do I change the language?
 Quote

Status: offline

Tirano

Forum User
Newbie
Registered: 02/27/08
Posts: 8
Hi, I'm having a little problem with the date codification and I'll rather post here than opening a new one...

It doesn't matter what codification and locale settings y choose (I've tried all combinations of utf-8, ISO or Unicode with es_ES) I get weird symbols where some special characters should appear on the date. I understand that this data is obtained from the server so, do you think they might have something to do with that?

Thanks a lot!!
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Try playing with this little PHP script and see what it reports:
Text Formatted Code
<?php

echo "<p>Default date format: " . strftime ("%A, %x");    

$result = setlocale (LC_ALL, 'es_ES');

if ($result === false) {
    echo "<p>Error when changing locale";
} else {
    echo "<p>Switched to locale $result, date format is now: ";
    echo strftime ("%A, %x");    
}

?>

bye, Dirk
 Quote

Status: offline

Tirano

Forum User
Newbie
Registered: 02/27/08
Posts: 8
Default date format: Wednesday, 03/05/08

Switched to locale es_ES, date format is now: miércoles, 05/03/08


No weird symbols there... so if languaje files, charset or server has nothing to do what I'm I doing wrong then?
 Quote

Status: offline

Tirano

Forum User
Newbie
Registered: 02/27/08
Posts: 8
In case it's useful for someone... I found out that the codification in the tag plugin language file was overriding the config.php file for the whole site, I just changed utf-8 to ISO and everything was fixed.

Thanks for that little code, Dirk.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Thanks for reporting the solution - I was wondering what it could be.

Did you report the problem to the author of the Tag plugin?

bye, Dirk
 Quote

Status: offline

samstone

Forum User
Full Member
Registered: 09/29/02
Posts: 820
Instead of changing it to iso, you might want to remove the line altogether. Dirk suggested this before:

http://www.geeklog.net/forum/viewtopic.php?forum=2&amp;showtopic=81497&amp;highlight=tag%20plugin

Peace!

Sam
 Quote

All times are EST. The time is now 10:42 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content