Posts: 357
Threads: 23
Joined: Dec 2009
Hello!!
This is not a problem, but did not know where to put the post.
Is it possible to save the date of the page xml in spanish?.
In the web appears: "Publicado el January 17th, 2010". I want that it appears in spanish if it is possible.
I have been looking for ways to save it, but i have not found it.
Regards and thanks.
Posts: 972
Threads: 27
Joined: Aug 2009
I believe GetSimple gets the date straight from your server. So you will have to tell your server to give back Spanish dates.
You can set the default language PHP returns its values in using
setlocale().
Posts: 357
Threads: 23
Joined: Dec 2009
I did not know it.
I have changed in /etc/php5/apache2/php.ini, the date.timezone= "Europe/Madrid", but continuous with the same.
Do you know what must be changed?
Thanks.
Posts: 339
Threads: 27
Joined: Nov 2009
You need to change the default language of the server. You only changed the timezone which just changes the time printed out.
Or, you could create an array for the time to convert it to Spanish when printed.
Posts: 357
Threads: 23
Joined: Dec 2009
Thanks internet54, but i do not find the way of changing the default language to the server apache.
I´m thinking in the array, but i have a little experience in this themes. I´ll try it.
REgards.
Posts: 972
Threads: 27
Joined: Aug 2009
Or you use
setlocale() as I
mentioned …
Example:
Code:
setlocale(LC_ALL, 'nl_NL');
Will make all PHP output be Dutch. You just have to find and put in the language code for Spanish.
Posts: 111
Threads: 14
Joined: Jan 2010
2010-01-25, 04:56:10
(This post was last modified: 2010-01-25, 05:05:12 by martynas.barzda.)
Posts: 357
Threads: 23
Joined: Dec 2009
2010-01-26, 04:12:25
(This post was last modified: 2010-01-26, 04:17:57 by baris.)
Yes Zegnåt. i have tried it too, but the result is the same.
I have created a php and several tests, and always the result is in english (:.
Code:
<?php
$Fecha_num="2007-08-12";
/* Windows con apache
setlocale(LC_TIME, 'Spanish'); */
/* Apache con linux */
/* setlocale(LC_TIME, 'es_ES'); */
// setlocale(LC_TIME, 'de_DE');
// echo strftime('%A, %d. %B %Y');
/* setlocale(LC_TIME, 'es_MX'); */
setlocale(LC_TIME, 'es_ES');
echo $fecha=strftime('%d %B %Y',strtotime($Fecha_num));
?>
Regards
Edit: i have installed
apache2-mpm-prefork
Posts: 339
Threads: 27
Joined: Nov 2009
Take a look at this and it my point you in a simple direction.
http://snipplr.com/view/3644/php--multip...e-spanish/
Posts: 357
Threads: 23
Joined: Dec 2009
Thanks Nijikokun.
Thanks one time more internet54.
This function must be used when the system getsimple saves the date in the page.xml, is this so?.
Regards.