Forum: Ruby on Rails Translate nested model errors

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
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
This topic is locked and can not be replied to.