Beware of Rails autoloading conventions. Your file should have a
`translate_for_models.rb` name,
Karel
On Jan 2, 10:41 am, "Redd Vinylene" <
reddvinyl...@gmail.com> wrote:
> Actually, no it doesn't. I still have to do I18n.t instead of t in
> person.rb, despite TranslateForModels in lib/i18n.rb.
>
>
>
> On Fri, Jan 2, 2009 at 10:37 AM, Redd Vinylene <
reddvinyl...@gmail.com> wrote:
> > Once again, thank you so much!
>
> > Works perfectly!
>
> > On Thu, Jan 1, 2009 at 6:44 PM, Iain Hecker <
i...@iain.nl> wrote:
>
> >> Maybe using the application helper is not a good idea, because it has
> >> methods specific to views, but you can make your own module and mix it
> >> in.
>
> >> module TranslateForModels
> >> def t(*args); I18n.t(*args); end
> >> end
> >> ActiveRecord::Base.send :include, TranslateForModels
>
> >> The proper place would be in the lib directory.
>
> >> Iain
>
> >> On Thu, Jan 1, 2009 at 15:56, Redd Vinylene <
reddvinyl...@gmail.com> wrote:
>
> >>> Thank y'all so much!
>
> >>> I got the following in applications_helper.rb so I can say t instead of I18n.t:
>
> >>> def t(*args)
> >>> translate(*args)
> >>> end
>
> >>> How do I make this work for my models as well? Would an "extend
> >>> ApplicationsHelper" to person.rb be a wise choice? I've heard some
> >>> people don't really like that.
>
> >>> Cheers!
>
> >>> On Thu, Jan 1, 2009 at 2:44 PM, Iain Hecker <
i...@iain.nl> wrote:
>
> >>>> Hi Redd,
>
> >>>> yes
>
> >>>> Iain
>
> >>>> PS: Just add I18n.t(h) at the last line
>