ActiveAdmin: Translation Missing with a Hash in the key name

27 views Asked by At

I have a simple ActiveRecord model LocaleInfo.

# Table name: locale_infos
#
#  id            :string           not null, primary key
#  created_at    :datetime         not null
#  updated_at    :datetime         not null
#  country_code  :string
#  currency_code :string

Validating some of its data.

  validates :id, on: :create, format: {with: LOCALE_REGEX}, uniqueness: {case_sensitive: false}
  validates :country_code, presence: true
  validates :currency_code, presence: true

When checking validation message on the console, they're properly i18n-ized.

irb(main):006> l = LocaleInfo.new

irb(main):007> l.validate

irb(main):008> l.errors.full_messages
=> ["Id is invalid", "Country code can't be blank", "Currency code can't be blank"]

However, when I try the same inside of ActiveAdmin, I get a proper messages under the individual fields, but with a strange yellow warning at the top stating Translation missing: en.{:resource_name=>"locale info", :downcase_resource_name=>"locale info", :default=>[""]}.

enter image description here

I was unable to find help so far online and I am having difficulties browsing its source code. If anyone experienced something similar and can share its knowledge & ideally a fix, it be of great help!

Thanks in advance.

0

There are 0 answers