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
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
8
13
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?
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?
10
11
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!!
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!!
12
8
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:
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
Text Formatted Code
<?phpecho "<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
12
13
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?
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?
9
11
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.
Thanks for that little code, Dirk.
14
11
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&showtopic=81497&highlight=tag%20plugin
Peace!
Sam
http://www.geeklog.net/forum/viewtopic.php?forum=2&showtopic=81497&highlight=tag%20plugin
Peace!
Sam
6
13
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