I am trying to localize in Rails 3, and I don't understand the change
w Rails 2 ...
I wrote the following hierarchy :
en:
model:
user: User
attributes:
login: Login
email: Email
password: Password
roles: Roles
and tried to use in my view I18n.t('user.roles') to get the
localization of roles
but cannot find it : translation missing: fr, user, roles
In rails 2 I had to stipulate activerecord: should I do it also w
Rails 3 ?
thansk for your feedback
on 2010-09-24 19:24
on 2010-09-24 19:31
2010/9/24 Erwin <yves_dufour@mac.com> > email: Email > password: Password > roles: Roles > > and tried to use in my view I18n.t('user.roles') to get the > localization of roles > but cannot find it : translation missing: fr, user, roles > I think you don't have to indent attributes in model. Try this: en: model: user: User attributes: user: login: Login email: Email password: Password roles: Roles
on 2010-09-24 19:42
On Fri, Sep 24, 2010 at 19:22, Erwin <yves_dufour@mac.com> wrote: > email: Email > password: Password > roles: Roles > > and tried to use in my view I18n.t('user.roles') to get the > localization of roles > but cannot find it : translation missing: fr, user, roles > > In rails 2 I had to stipulate activerecord: should I do it also w > Rails 3 ? Haven't used Rails 3 myself. Just try it and see, though. I would guess you need to put the translation in activerecord.attributes.user.roles. Once you use that convention, you can do User.human_attribute_name(:roles) instead of I18n.t("activerecord.attributes.user.roles"). Assuming that didn't change from Rails 2.
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.