Sha256: 2916a99f7a1aa6149cb64a256c2b3be1f43f61c1af71f8508a611f4a9de47789

Contents?: true

Size: 689 Bytes

Versions: 5

Compression:

Stored size: 689 Bytes

Contents

module Aureus

  module Generators

    class DeviseInvitableI18nGenerator < 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 invitable 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_invitable_i18n/devise_invitable_i18n_generator.rb
aureus-2.1.3 lib/generators/aureus/devise_invitable_i18n/devise_invitable_i18n_generator.rb
aureus-2.1.2 lib/generators/aureus/devise_invitable_i18n/devise_invitable_i18n_generator.rb
aureus-2.1.1 lib/generators/aureus/devise_invitable_i18n/devise_invitable_i18n_generator.rb
aureus-2.1.0 lib/generators/aureus/devise_invitable_i18n/devise_invitable_i18n_generator.rb