Welcome to Geeklog, Anonymous Monday, December 23 2024 @ 09:43 pm EST
Geeklog Forums
Change language on date
Status: offline
Cohin
Forum User
Newbie
Registered: 12/31/03
Posts: 14
Hello, I would like to ask you how to change the language on the date, now in English, in my Spanish page. I would like all dates, the top wellcome date, and the article dates to show in Spanish and I do not know how to change that. Thank you
20
18
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Try 'es_ES' (with an underscore).
It's also possible that your hosting service does not support Spanish (especially if it's cheap / free hosting or located in another country).
Btw, I just wrote an FAQ entry explaining the language and locale settings.
bye, Dirk
It's also possible that your hosting service does not support Spanish (especially if it's cheap / free hosting or located in another country).
Btw, I just wrote an FAQ entry explaining the language and locale settings.
bye, Dirk
16
15
Quote
Status: offline
Cohin
Forum User
Newbie
Registered: 12/31/03
Posts: 14
Looked at lots angles on this, my Unix server does allow Spanish and everything seams to be in order, yet my date is in English. I looked around the web at other Geeklog sites in Spanish, and everyone I saw has the dates in Englist. I will continue looking for a solution, once I find it I let you know.
20
16
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Try this little script:
echo "<p>Today is " . strftime ("%A");
$result = setlocale (LC_ALL, 'es_ES');
if ($result === false) {
echo "<p>An error occured when switching the locale.";
} else {
echo "<p>Switched to locale " . $result;
echo "<p>Today is " . strftime ("%A");
}
?>
If it produces an error message, try replacing "LC_ALL" with "LC_TIME" and see if that makes a difference.
bye, Dirk
Text Formatted Code
<?phpecho "<p>Today is " . strftime ("%A");
$result = setlocale (LC_ALL, 'es_ES');
if ($result === false) {
echo "<p>An error occured when switching the locale.";
} else {
echo "<p>Switched to locale " . $result;
echo "<p>Today is " . strftime ("%A");
}
?>
bye, Dirk
15
16
Quote
Status: offline
Cohin
Forum User
Newbie
Registered: 12/31/03
Posts: 14
It gives me
no error message.
My config.php is
What am I doing wrong Dirk?
Today is Saturday
Switched to locale es_ES
Today is sábado
Switched to locale es_ES
Today is sábado
no error message.
My config.php is
$_CONF['language'] = 'spanish';
$_CONF['locale'] = 'es-ES';
$_CONF['date'] = '%A, %B %d %Y @ %I:%M %p %Z';
$_CONF['daytime'] = '%m/%d %I:%M%p';
$_CONF['shortdate'] = '%x';
$_CONF['dateonly'] = '%d-%b';
$_CONF['timeonly'] = '%I:%M %p %Z';
$_CONF['default_charset'] = 'es-ES.iso-8859-1';
$_CONF['rdf_language'] = 'es-ES'; // may have to be different than the locale
$_CONF['locale'] = 'es-ES';
$_CONF['date'] = '%A, %B %d %Y @ %I:%M %p %Z';
$_CONF['daytime'] = '%m/%d %I:%M%p';
$_CONF['shortdate'] = '%x';
$_CONF['dateonly'] = '%d-%b';
$_CONF['timeonly'] = '%I:%M %p %Z';
$_CONF['default_charset'] = 'es-ES.iso-8859-1';
$_CONF['rdf_language'] = 'es-ES'; // may have to be different than the locale
What am I doing wrong Dirk?
10
16
Quote
All times are EST. The time is now 09:43 pm.
- 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