translate_enum icon indicating copy to clipboard operation
translate_enum copied to clipboard

Added global configuration support

Open zerocool4u2 opened this issue 4 years ago • 0 comments

Hi I needed to add global configuration support for an app that I was working on, had lots of lists and the activerecord.attributes file started to feel too clogged, but also didn't want to add a block for each class on the translate_enum methods. It could be useful in the future to easily add new global settings. Let me know if you are interested in adding this to the project, I tried to change as little as possible, but it could use some improvements.

# config/initializers/translate_enum_config.rb
TranslateEnum.configure do |config|
    config.i18n_scope = 'translate_enums'
end

then call the configuration like

TranslateEnum.config.i18n_scope

zerocool4u2 avatar Jan 10 '21 11:01 zerocool4u2