Description
Describe the bug
I'm trying to display transition events in an admin page, and so events translation are not working 😞
I'm I missing something or miss reading it, or is actually not working?
To Reproduce
Steps to reproduce the behavior:
1 - Define translations for any of your event models. In my case I have Order
with process
event for example.
2 - Call order.aasm.events(permitted: true).map(&:name)
Expected behavior
I would expect that my call to mymodel.aasm.events.map(&:name)
return my possible transition events translated given my es.yml
Screenshots
Translations
es:
activerecord:
events:
order:
process: 'Procesar'
accept: 'Aceptar'
Active Admin call
action_item :change_status, only: :show do
order = Order.find(params[:id])
dropdown_menu 'Admin' do
order.aasm.events(permitted: true).map do |state|
item state.name, advance_admin_order_path(state: state.name)
end
end
end
Output:
(I should be in Spanish according es.yml)
Additional context
I was checking spec/en.yml
for some context about how to build my events translations.
But this is not displayed properly