Sha256: c1e23ca884b5cbda96c864d8541d5789a94e95d80e7aeca25d0a63f7231ac689

Contents?: true

Size: 540 Bytes

Versions: 4

Compression:

Stored size: 540 Bytes

Contents

require "active_generator/base"
require "generators/locale/base"

module Locale
  class ControllerGenerator < Rails::Generators::NamedBase
    include ActiveGenerator::Base
    include Locale::Base

    source_root File.expand_path('../templates', __FILE__)
    argument :language, type: :string, required: false, default: "en", desc: "The locale alpha code"

    def copy_jbuilder_file
      assert_valid_language!
      template("jbuilder.yml", "config/locales/#{language}/jbuilders/#{namespace_path}/#{file_name}.yml")
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
active_generator-2.0.8 lib/generators/locale/jbuilder/jbuilder_generator.rb
active_generator-2.0.7 lib/generators/locale/jbuilder/jbuilder_generator.rb
active_generator-2.0.6 lib/generators/locale/jbuilder/jbuilder_generator.rb
active_generator-2.0.5 lib/generators/locale/jbuilder/jbuilder_generator.rb