Class: I18nFactory::Generators::ModelGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/model_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#current_localeObject

Returns the value of attribute current_locale.



19
20
21
# File 'lib/generators/model_generator.rb', line 19

def current_locale
  @current_locale
end

Instance Method Details

#create_i18_fileObject



21
22
23
24
25
26
# File 'lib/generators/model_generator.rb', line 21

def create_i18_file
  I18nFactory::Locale.all.each do |locale|
    self.current_locale = locale
    template 'i18n.yml.erb', path_for_i18n(locale)
  end
end