Thanks Karel, I learned something new today, as the l()/t() helpers were new to me. I also believe that it is better to leave the date.to_s alone, as we want programmatic consistent behavior in our code. Changing to_s is a simple shortcut, but can cause problems if we have made assumptions on string conversions of dates. I love it!
--stonefield On Nov 30, 11:46 am, Karel Minarik <[EMAIL PROTECTED]> wrote: > 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/activ... > > 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/boo... > > --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 -~----------~----~----~----~------~----~------~--~---
