Class: I18n::LocaleGenerator

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

Instance Method Summary collapse

Instance Method Details

#mainObject



5
6
7
8
9
10
11
12
# File 'lib/generators/i18n/locale/locale_generator.rb', line 5

def main
  unless file_name =~ /^[a-zA-Z]{2}([-_][a-zA-Z]+)?$/
    log 'ERROR: Wrong locale format. Please input in ?? or ??-?? format.'
    exit
  end
  generate_configuration
  fetch_from_rails_i18n_repository
end