Names of months in Archive Extension

Hi,

I want to have listed archive with months and years in polish language.
By default this is english language. If I use command:
“<r:date format=”%B %Y" />" I got for example June 2007. Instead of
“June” I want to have polish equivalent. What I have to do??

Regards, Artur

Artur B. wrote:

I want to have listed archive with months and years in polish language.
By default this is english language. If I use command:
“<r:date format=”%B %Y" />" I got for example June 2007. Instead of
“June” I want to have polish equivalent. What I have to do??

I’d suggest that you create a set of polish date tags in an extension.
You may need to copy the Archive pages as well.


John L.
http://wiseheartdesign.com

Also consider that this is a limitation of Ruby and not necessarily
Radiant. You may need to find a library that overrides the Date, Time,
and DateTime classes to localize date names.

Sean

±le 23.10.2007 13:33:01 +0200, Artur B. a dit :
| Hi,
|
| I want to have listed archive with months and years in polish language.
| By default this is english language. If I use command:
| “<r:date format=”%B %Y" />" I got for example June 2007. Instead of
| “June” I want to have polish equivalent. What I have to do??

You’ll need some kind of polish extension, like the one I made for
french
dates[1].

Regards,

1: http://mat.cc/dev/index.cgi/french_dates/
and http://mat.cc/dev/index.cgi/french_dates/archive/tip.tar.gz

You can try to overwrite Ruby’s month constants with backdoor:

<r:ruby>
Date.MONTHNAMES = [nil] + %w(January February March April May
June
July August September October November December)
Date.ABBR_MONTHNAMES = [nil] + %w(Jan Feb Mar Apr May Jun Jul Aug
Sep
Oct Nov Dec)
</r:ruby>

May work, nor not.  Not tested.

/AITOR

Artur,

I am using a Rails plugin called Dutchify. Its code may help you develop
a Polify, or someting like that.
Dutchify is quite dirty as it overrides the Ruby date and time classes.
Works well though.

Don’t forget to restart Radiant after you install this plugin :wink:

Regards,
Erik.

Sean C. wrote:

John L.


Erik van Oosten
http://2008.rubyenrails.nl/

±le 25.10.2007 15:43:15 +0200, Artur B. a dit :
| Mathieu A. wrote:
|> ±le 23.10.2007 13:33:01 +0200, Artur B. a dit :
|> | Hi,
|> |
|> | I want to have listed archive with months and years in polish language.
|> | By default this is english language. If I use command:
|> | “<r:date format=”%B %Y" />" I got for example June 2007. Instead of
|> | “June” I want to have polish equivalent. What I have to do??
|>
|> You’ll need some kind of polish extension, like the one I made for
|> french
|> dates[1].
|>
|> Regards,
|>
|> 1: http://mat.cc/dev/index.cgi/french_dates/
|> and http://mat.cc/dev/index.cgi/french_dates/archive/tip.tar.gz
|
| I’ve downlaod your extension and try to install, but got error during
| rake:
|
| rake aborted!
| undefined method to_datetime' for class Time’

Hum, I have no clue about that, because, hum, it works for me.
The <require ‘date’> should take care of creating the private methods, I
don’t see why it does not for you.

Maybe an old ruby version ?

Mathieu A. wrote:

±le 23.10.2007 13:33:01 +0200, Artur B. a dit :
| Hi,
|
| I want to have listed archive with months and years in polish language.
| By default this is english language. If I use command:
| “<r:date format=”%B %Y" />" I got for example June 2007. Instead of
| “June” I want to have polish equivalent. What I have to do??

You’ll need some kind of polish extension, like the one I made for
french
dates[1].

Regards,

1: http://mat.cc/dev/index.cgi/french_dates/
and http://mat.cc/dev/index.cgi/french_dates/archive/tip.tar.gz

I’ve downlaod your extension and try to install, but got error during
rake:

rake aborted!
undefined method to_datetime' for class Time’

Any suggestions?

My ruby version:

ruby 1.8.5 (2006-12-04 patchlevel 2).

It’s to old ?