I need to have custom validation messages in my ActiveRecord models internationalized. Currently, I’m using something like this, which works:
validates_uniqueness_of :name, :message => lambda { I18n.t(:family_name_in_use) }
I know Rails has validation message translations builtin, but for reasons I can’t go into here, I can’t use those. Is there a nicer solution than this lambda thing? I’m using Rails 2.3.8, if that matters.
I ultimately stuck with the
lambdasolution.