Search code examples
ruby-on-railsrails-admin

How to translate the models names showing in the rails_admin's panel?


I want to change how the models names showing in my rails_admin's panel, but I no figure out how to do it...

This is what I want to translate: image
Note: the models names looks weird because I'm using this configuration is my inflections.rb:

ActiveSupport::Inflector.inflections(:es) do |inflect|
    inflect.plural /([^djlnrs])([A-Z]|_|$)/, '\1s\2'
    inflect.plural /([djlnrs])([A-Z]|_|$)/, '\1es\2'
    inflect.plural /(.*)z([A-Z]|_|$)$/i, '\1ces\2'

    inflect.singular /([^djlnrs])s([A-Z]|_|$)/, '\1\2'
    inflect.singular /([djlnrs])es([A-Z]|_|$)/, '\1\2'
    inflect.singular /(.*)ces([A-Z]|_|$)$/i, '\1z\2'
end

I have this in my es.yml (I'm using Mongoid instead of ActiveRecord):

mongoid:
    models:
      comment: "Comentarios"
      product: "Productos"
      quotation: "Cotizaciones"
      requisition: "Requisiciones"
      user: "Usuarios"

But it seems that it is not enough to change it in the rails_admin's panel


Solution

    1. Setting up :en is default
    2. Changing the values in es.yml

    However, you need to make sure that the admin's panel is using these files. In this case I suspect it doesn't.