(Rails 2.3.8)
Say I have in config/locales/en.yml:
en:
activerecord:
attributes:
foo:
bar: ‘Long%{br}name’
Now, in HTML I can do:
t(:‘activerecord.attributes.foo.bar’, :br => ‘
’)
and in LaTeX:
t(:‘activerecord.attributes.foo.bar’, :br => ‘\\’)
However, this is doomed to fail with AR validations, e.g.:
Model
class Foo < ActiveRecord::Base
validates_presence_of :bar
end
View Error
I18n::MissingInterpolationArgument in Foo#create
missing interpolation argument in “Long%{br}name” ({:count=>“1”} given)
So how do I pass :br to ‘activerecord.attributes.foo.bar’ in the context
of Foo?
Or is my approach wrong altogether?
Thank you