J
Jesper Rønn-Jensen
I'm working on a Rails plugin that localizes default Time/Date formats.
I want to override the standard month and daynames with local variants,
but for some reason I can't override the default Time month and
daynames.
irb(main):010:0> Time.new
=> Mon Aug 21 20:47:52 Romance Daylight Time 2006
irb(main):011:0> Time::RFC2822_DAY_NAME
=> ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
irb(main):012:0> Time::RFC2822_DAY_NAME = %{søn man tir ons tor fre
lør}
(irb):12: warning: already initialized constant RFC2822_DAY_NAME
irb(main):014:0> Time.new
=> Mon Aug 21 20:49:36 Romance Daylight Time 2006
As you see from the above: The dayname is not overridden. How do I
override it?
However, I can easily override the locale format (at leas when I do it
from Rails). But that doesn't help much when month and daynames are
still in English.
Please let me know your thoughts on how I change English month and
daynames to local.
I want to override the standard month and daynames with local variants,
but for some reason I can't override the default Time month and
daynames.
irb(main):010:0> Time.new
=> Mon Aug 21 20:47:52 Romance Daylight Time 2006
irb(main):011:0> Time::RFC2822_DAY_NAME
=> ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
irb(main):012:0> Time::RFC2822_DAY_NAME = %{søn man tir ons tor fre
lør}
(irb):12: warning: already initialized constant RFC2822_DAY_NAME
irb(main):014:0> Time.new
=> Mon Aug 21 20:49:36 Romance Daylight Time 2006
As you see from the above: The dayname is not overridden. How do I
override it?
However, I can easily override the locale format (at leas when I do it
from Rails). But that doesn't help much when month and daynames are
still in English.
Please let me know your thoughts on how I change English month and
daynames to local.