17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2193 Views |
-
Blog: Date translation

3 June 2008 at 4:00am
Hey,
i can´t seem to figure out how to translate the dates in the blog system. Such as Browse by Date "May 2008", i would need to translate "May".
Are you using phpsetlocale?, if so is there any other way i can translate this since i don´t have the spanish locale installed and can´t install it.
Thanks a lot!. I appreciate all help.
-
Re: Blog: Date translation

4 June 2008 at 1:02am Last edited: 4 June 2008 1:04am
Hi masson!
I solved the problem by adding and changing the folowing code in the sapphire/core/model/fieldtypes/Date.php file:function Format($formattingString) {
if($this->value) return date($formattingString, strtotime($this->value));
function FormatDate($format) {
if ($this->value) $mydate = strftime($format, strtotime($this->value));
return utf8_encode($mydate);
Call the function width $Date.FormatDate(%B %Y).
That should work out!
Caution: To see other languages the setlocal for the language must be installed on your server!the _config.php needs this to use it (for German e.g.):
i18n::set_locale('de_DE');
setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge'); -
Re: Blog: Date translation

2 November 2008 at 1:52pm
Thats nice! Thank you very much. You should submit it to the developers...
| 2193 Views | ||
|
Page:
1
|
Go to Top |


