You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The only thing I found related to translating enum values is this: #1994. I'm not sure if I'm missing or configuring my i18n wrong and this should already work out of the box. Would this be an addition you would accept?
What would you like to be able to do? Can you provide some examples?
Initially I was just trying to get an enum displayed in an index page to be upercase. So instead of displaying closed, display Closed. I thought it'd make sense to use i18n for this as well.
Similar for booleans
How could we go about implementing that?
The most basic thing I found that worked was adding
# en.yml in administrateen:
true: "true"false: "false"# boolean.rbdefto_sI18n.t(data.to_s)end# select.rbdefdataI18n.translate(super)end
This worked. I am not familiar with the codebase, but I guess the translation would fit better in the views. And for select fields, the translations should look more like:
The only thing I found related to translating enum values is this: #1994. I'm not sure if I'm missing or configuring my i18n wrong and this should already work out of the box. Would this be an addition you would accept?
Initially I was just trying to get an enum displayed in an
index
page to be upercase. So instead of displayingclosed
, displayClosed
. I thought it'd make sense to use i18n for this as well.Similar for booleans
The most basic thing I found that worked was adding
This worked. I am not familiar with the codebase, but I guess the translation would fit better in the views. And for select fields, the translations should look more like:
The text was updated successfully, but these errors were encountered: