Sha256: 08065a22c01f3cd13821bd074bc872bbd1957ae50e3066fda23c31f2bcff616f

Contents?: true

Size: 670 Bytes

Versions: 5

Compression:

Stored size: 670 Bytes

Contents

module Aureus

  module Generators

    class DeviseI18nGenerator < Rails::Generators::Base

      desc 'generates base i18n files for the devise views'
      source_root File.expand_path('../locales', __FILE__)
      argument :language, type: :string, default: 'en'

      def generate
        file_list = Dir.glob("#{File.dirname(__FILE__)}/locales/*.#{language}.yml")
        puts "Generating locale files for language: '#{language}'..."
        file_list.each do |locale_file|
          basename = File.basename(locale_file)
          destination = "config/locales/#{basename}"
          copy_file locale_file, destination
        end
      end

    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
aureus-2.1.4 lib/generators/aureus/devise_i18n/devise_i18n_generator.rb
aureus-2.1.3 lib/generators/aureus/devise_i18n/devise_i18n_generator.rb
aureus-2.1.2 lib/generators/aureus/devise_i18n/devise_i18n_generator.rb
aureus-2.1.1 lib/generators/aureus/devise_i18n/devise_i18n_generator.rb
aureus-2.1.0 lib/generators/aureus/devise_i18n/devise_i18n_generator.rb