-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
bugbreakages in functionality that is implementedbreakages in functionality that is implemented
Description
- What were you trying to do?
Translations for a polymorphic field item. here's an example. Item can be a program or a session and both are translated in the locale.yml file
I have aGroupItemDashboard:
ATTRIBUTE_TYPES = {
# cannot be made searchable ...
item: Field::Polymorphic.with_options(
classes: [Program, Session],
order: "lms_data ->'name' ASC"
),
group: Field::BelongsTo.with_options(
searchable: false
),
}
FORM_ATTRIBUTES = %i[
item
group
].freeze
In my locale.yml file I have :
activerecord:
models:
item:
one: Session Ou Parcours
other: Sessions ou Parcours
program:
one: Parcours
other: Parcours
session:
one: Session
other: Sessions
group:
one: Groupe
other: Groupes
However, those translations for polymorphic fields are never taken into account. Neither for the input label or within the select options (see here label is "item", and select options refer to "programs" and not "parcours") :

Is there any way to add a translation for a polymorphic field ?
* What did you end up with (logs, or, even better, example apps are great!)?
* What versions are you running?
- Rails 6.0.3
- administrate 0.15.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugbreakages in functionality that is implementedbreakages in functionality that is implemented