scarfacedeb / rails_admin_globalize_field

Tabbed interface and custom field type for globalize translations for Rails_admin
MIT License
50 stars 60 forks source link

How to translate field names? #32

Closed felix91gr closed 4 years ago

felix91gr commented 4 years ago

Hi,

I'm using the gem for translating 3 fields, Title, Summary and Description:

image

However, I've been trying to localize the field labels ("Title", "Summary", "Description") to my 3 locales, with no success. I'm using the traditional path to translating my model names and attributes, that is, for each locale, using the name locale.activerecord.{attributes, models}.*.

Here is the page of our project, this is how my localization files look and this is how my rails admin initializer looks.

felix91gr commented 4 years ago

What I'm trying to ask is this: can I translate the labels? And if so, how?

scarfacedeb commented 4 years ago

@felix91gr Hi Felix, you'll have to use Translation model keys, such as:

en:
  activerecord:
    attributes:
      initiative/translation:
        title: "Custom title"
        summary: "Summary text"
felix91gr commented 4 years ago

Holy shit @scarfacedeb, you both answered quickly and with what I needed. Thank you so much <3