DEV: Generate correct i18n keys for wizard radio choices (#28370)

If you wizard step has a dash in it, e.g. foo-bar, the wrong i18n key will be inferred for selects. This PR ensures the key is underscored.
This commit is contained in:
Ted Johansson 2024-08-14 14:39:18 +02:00 committed by GitHub
parent 1bcb5c4e21
commit 059a8a0ff5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,7 +10,7 @@ class WizardFieldChoiceSerializer < ApplicationSerializer
def i18nkey def i18nkey
field = object.field field = object.field
step = field.step step = field.step
"wizard.step.#{step.id}.fields.#{field.id}.choices.#{id}" "wizard.step.#{step.id}.fields.#{field.id}.choices.#{id}".underscore
end end
def label def label