Sha256: 36afeed542f3fd53face6613bf8180b312859a5b3291f106759dfd1245b2eae7

Contents?: true

Size: 576 Bytes

Versions: 18

Compression:

Stored size: 576 Bytes

Contents

module ActiveEnum
  module Generators
    class LocaleGenerator < Rails::Generators::Base
      desc "Copy ActiveEnum locale file for I18n storage"
      source_root File.expand_path('../templates', __FILE__)
      class_option :lang, :type => :string, :default => 'en', :desc => "Language for locale file"

      def copy_initializers
        template 'locale.yml',  locale_full_path
      end

      def locale_filename
        "active_enum.#{options[:lang]}.yml"
      end

      def locale_full_path
        "config/locales/#{locale_filename}"
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
active_enum-1.2.1 lib/generators/active_enum/locale_generator.rb
active_enum-1.2.0 lib/generators/active_enum/locale_generator.rb
active_enum-1.1.0 lib/generators/active_enum/locale_generator.rb
active_enum-1.0.0 lib/generators/active_enum/locale_generator.rb
active_enum-1.0.0.rc8 lib/generators/active_enum/locale_generator.rb
active_enum-1.0.0.rc7 lib/generators/active_enum/locale_generator.rb
active_enum-1.0.0.rc6 lib/generators/active_enum/locale_generator.rb
active_enum-1.0.0.rc5 lib/generators/active_enum/locale_generator.rb
active_enum-1.0.0.rc4 lib/generators/active_enum/locale_generator.rb
active_enum-1.0.0.rc3 lib/generators/active_enum/locale_generator.rb
active_enum-1.0.0.rc2 lib/generators/active_enum/locale_generator.rb
active_enum-1.0.0.rc1 lib/generators/active_enum/locale_generator.rb
active_enum-1.0.0.pre lib/generators/active_enum/locale_generator.rb
active_enum-0.9.12 lib/generators/active_enum/locale_generator.rb
active_enum-0.9.11 lib/generators/active_enum/locale_generator.rb
active_enum-0.9.10 lib/generators/active_enum/locale_generator.rb
active_enum-0.9.9 lib/generators/active_enum/locale_generator.rb
active_enum-0.9.8 lib/generators/active_enum/locale_generator.rb