I'm using Rails 5.2.1, and trying to override the names of some ActiveRecord models and fields.
I know that Rails is picking up the English locale file because when I add the following to locales/en.yml
, my form labels are updated to the correct values:
en:
activerecord:
models:
seller_address: "Address"
attributes:
seller_address:
name: "Name"
street1: "Street Line 1"
postal_code: "Postal Code"
But when I call @seller_address.errors.full_messages
I'm still seeing the old field and model values. For example, this:
Seller addresses name can't be blank
Seller addresses street1 can't be blank
Seller addresses postal code can't be blank
should be this:
Addresses Name can't be blank
Addresses Street Line 1 can't be blank
Addresses Postal Code can't be blank
What can I do to tell Rails to use my locale overrides for ActiveRecord validation error messages?