Sha256: 3d3b3174299a15eba2151111eaa3cc3e4524d24d162ebe25bccdf9c971131370
Contents?: true
Size: 846 Bytes
Versions: 2
Compression:
Stored size: 846 Bytes
Contents
class I18nAttributes::InstallGenerator < Rails::Generators::Base source_root File.expand_path('../templates', __FILE__) def create_initializer_file initializer 'i18n_attributes.rb' do %Q/ if Rails.env.development? I18nAttributes.configure do |config| #more > I18n.available_locales config.locales = [:en, :"zh-CN"] config.enums_attributes = { "gender" => {"male" => "Male", "female" => "Female"}, "state" => {"pending" => "Pending", "processing" => "Processing", "processed" => "Processed"}, "category" => {"a" => "A", "b" => "B"} } end end / end end def modify_application_config inject_into_file 'config/application.rb', :after => /< Rails::Application[\s]*$/ do %Q| config.i18n.load_path += Dir[%Q`\#{config.root}/config/locales/**/*.{rb,yml}`] | end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
i18n_attributes-0.1.3 | lib/generators/i18n_attributes/install/install_generator.rb |
i18n_attributes-0.1.2 | lib/generators/i18n_attributes/install/install_generator.rb |