Date translate

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
maiklas
Posts: 1
Joined: Mon May 19, 2008 9:31 am

Date translate

Post by maiklas »

Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

This requires editing of the gbook.php file.
Also your server must support the php setlocale function.

In GBook version 1.6 find line 749

Code: Select all

$added=date ("F j, Y");
and replace it with:

Code: Select all

setlocale(LC_TIME, "Dutch", "nl_NL");
$added=strftime("%A %d %B %Y, %H:%M");
This code gives dutch local strings. You have to change

Code: Select all

setlocale(LC_TIME, "Dutch", "nl_NL");
to your code, for example setlocale(LC_TIME, "en_US"); for US english
Read this page http://nl3.php.net/manual/en/function.setlocale.php for more information about setlocale function.

For windows server you can use the three character country code found in http://www.unicode.org/onlinedat/countries.html
Edit 16 july 2009: The webpage is not found anymore. Try the Language name column on the following page http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

For Linux server the a locale name is typically of the form language[_territory][.codeset][@modifier], where language is an ISO 639 language code, territory is an ISO 3166 country code, and codeset is a character set or encoding identifier like ISO-8859-1 or UTF-8. For a list of all supported locales, try "locale -a", cf. locale(1).
So ISO 639 language language code minimal http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes (639-1 column).
Also use the ISO 3166 territory code if needed http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 (Alpha-2 column)

From you link url I think you are from Lithuania. I think a working setlocale might be (not tested)

Code: Select all

setlocale(LC_TIME, "Lithuanian", "lt_LI");
For strftime settings read http://nl3.php.net/manual/en/function.strftime.php

Greetings,
Henrie
Post Reply