Class: Mails::Generators::I18nGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Mails::Generators::I18nGenerator
- Defined in:
- lib/generators/mails/i18n_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_locales ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/generators/mails/i18n_generator.rb', line 8 def add_locales %w(en.yml zh-CN.yml).each do |fname| path = "#{Rails.root}/config/locales/mails.#{fname}" if File.exists?(path) puts "Skipping config/locales/mails.#{fname} creation, as file already exists!" else puts "Adding locale (config/locales/mails.#{fname})..." template "config/locales/mails.#{fname}", path end end end |