Error with active Record translations

Gibson picture Gibson · May 19, 2014 · Viewed 7.9k times · Source

I'm getting an error when db:reset. I've read several posts about this, but none works for me.

The error says:

translation missing: es.activerecord.errors.messages.record_invalid

My locales/es.yml is:

es:
  activerecord:
    errors:
      messages:
        accepted: "must be accepted"
        blank: "can't be blank"
        confirmation: "doesn't match confirmation"
        empty: "can't be empty"
        equal_to: "must be equal to {{count}}"
        even: "must be even"
        exclusion: "is reserved"
        greater_than: "must be greater than {{count}}"
        greater_than_or_equal_to: "must be greater than or equal to {{count}}"
        inclusion: "is not included in the list"
        invalid: "is invalid"
        less_than: "must be less than {{count}}"
        less_than_or_equal_to: "must be less than or equal to {{count}}"
        not_a_number: "is not a number"
        odd: "must be odd"
        taken: "is already taken"
        too_long: "is too long (maximum is {{count}} characters)"
        too_short: "is too short (minimum is {{count}} characters)"
        wrong_length: "is the wrong length (should be {{count}} characters)"

Answer

Gibson picture Gibson · May 19, 2014

Fixed it by copying all of the locales translations from rails locales repo to my es.yml.

https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/es.yml