Forum: Ruby on Rails Translate nested model errors

969047aea93d01a9cc636e9867f4ec0f?d=identicon&s=25 Serafino Picozzi (serpico)
on 2013-10-07 18:50
Hi!

In rails 4, how do you translate model and attributes names for models
with accepts_nested_attributes_for? Everything works fine except for the
error messages of the nested model.

Here's what I have so far (without my attempt to translate the nested
model:

activerecord:
  errors:
    <<: *errors
  models:
    player: Giocatore
    score: Punteggio
  attributes:
    player:
      some_field: Blah...
    score:
      points: Punti

When a player is created, I have a nested form that allows the creation
of an initial score, therefore the Player model has:
accepts_nested_attributes_for :scores
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.