GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
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.
enum_attr :currency, %w(en ja), :init => I18n.locale, :localize => true do
label :en => "dollar"
label :ja => "yen"
Then if the website is in Japanese I will see 円 and if it is in English I will see ¥.
add 'localise' option to translate labels
DRY up localisation functions