Posted on: 01/17/04 12:35pm
By: Cohin
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
Re:Change language on date
Posted on: 01/17/04 12:51pm
By: Dirk
You have to set the correct
locale[*1] in config.php. For Spanish, try
$_CONF['locale'] = 'es_ES';
(assuming your site is running on a Unix-like system)
bye, Dirk
Re:Change language on date
Posted on: 01/17/04 01:00pm
By: Cohin
I actually had
$_CONF['language'] = 'spanish';
$_CONF['locale'] = 'es-ES';
and still shows in English rather than Spanish
Re:Change language on date
Posted on: 01/17/04 01:22pm
By: Dirk
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[*2] explaining the language and locale settings.
bye, Dirk
Re:Change language on date
Posted on: 01/17/04 02:27pm
By: Cohin
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.
Re:Change language on date
Posted on: 01/17/04 02:46pm
By: Dirk
Try this little script:
<?php
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
Re:Change language on date
Posted on: 01/17/04 03:24pm
By: Cohin
It gives me
Today is Saturday
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
What am I doing wrong Dirk?
Re:Change language on date
Posted on: 01/17/04 03:50pm
By: Dirk
[QUOTE BY= Cohin] $_CONF['locale'] = 'es-ES';[/QUOTE]
As I said above, try 'es_ES' with an underscore - you have a dash (minus) there ...
bye, Dirk
Re:Change language on date
Posted on: 01/17/04 03:57pm
By: Cohin
solved! Tnank you for your patince.