partydrone wrote in post #968419:
> OK. After much trial and error, here is the code that works:
>
> t("date.month_names")[8]
>
> Basically, call the I18n.translate method passing the date.month_names
> key which return an array of month names, then access the index for
> the desired month. (The first slot in the array is nil so indexes
> match names correctly).

Interesting.  Note that with Gettext-type I18n (e.g. with fast_gettext), 
this would be much simpler, just _(Date::MONTHNAMES[8]), since Gettext 
uses  the translatable string itself as a key rather than Rails' weird 
symbolic keys.  In general, I highly recommend using Gettext rather than 
Rails' default backend.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to