Class: HumanizerGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/humanizer_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_localesObject



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/generators/humanizer_generator.rb', line 8

def add_locales
  if options["show-locales"]
    puts "Available locales:\n" +
         "  - " + available_locales.sort.join("\n  - ")
  else
    if options["all-locales"]
      install_locales(available_locales)
    else
      check_locales!
      install_locales(selected_locales)
    end
  end
end