The Rails 2.2 release supports localization of dates entirely.
You can find the default formats in this file:
http://github.com/rails/rails/tree/2-2-stable/activesupport/lib/active_support/locale/en.yml
It is trivial to add your own formats, eg. in `RAILS_ROOT/config/
locales/de.rb`:
:time => {
:formats => {
:short_with_named_month => "%d. %b %H:%M",
}
}
And then use it like `I18n.l @book.published_on, :format =>
'short_with_named_month'`
Check out this line:
http://github.com/karmi/rails_i18n_demo_app/tree/master/app/views/books/index.html.erb#L17
--karmi
On Nov 30, 1:48 am, stonefield <[EMAIL PROTECTED]> wrote:
> have I misunderstood the usage.
> I am unsure whether localized dates are fully supported in Rails
> 2.2.2. When I tested it today I managed to get the input formatting in
> a localized order, but the output was still US-formatted. I installed
> Clemens' plugin and got it working - perfectly.
> Does anyone know if there is a good reason it is not yet implemented
> into Rails? If supporting I18n, shouldn't dates be a full part of it?
> (I'm counting days :-)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"rails-i18n" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rails-i18n?hl=en
-~----------~----~----~----~------~----~------~--~---