Skip to content

Conversation

@aklein-dex
Copy link

In my project, I'm using enumerated_attribute, but I need to display the options in the right language.
I added a new options ":localize", and if it's set to true, then the labels are translated.
Example:

enum_attr :currency, %w(en ja), :init => I18n.locale, :localize => true do 
  label :en => "dollar"
  label :ja => "yen"
end

Then if the website is in Japanese I will see 円 and if it is in English I will see ¥.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant