Sha256: cf1e9089e7fb8d47cb7254744f877a5ab5c65285ed39a98c3a3ef89e27af7436

Contents?: true

Size: 562 Bytes

Versions: 15

Compression:

Stored size: 562 Bytes

Contents

class Recipes::I18n < Rails::AppBuilder
  def ask
    languages = {
      "es-CL": "es-CL (Chile)",
      en: "en (USA)"
    }

    lang = answer(:locale) do
      languages.keys[Ask.list("What is the main locale of your app?", languages.values)]
    end

    set(:lang, lang)
  end

  def create
    gather_gem('rails-i18n')

    if equals?(:lang, :"es-CL")
      template('../assets/es-CL.yml', 'config/locales/es-CL.yml')
    end

    application("config.i18n.default_locale = '#{get(:lang)}'")
    application("config.i18n.fallbacks = [:es, :en]")
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
potassium-7.2.0 lib/potassium/recipes/i18n.rb
potassium-7.1.0 lib/potassium/recipes/i18n.rb
potassium-7.0.0 lib/potassium/recipes/i18n.rb
potassium-6.7.0 lib/potassium/recipes/i18n.rb
potassium-6.6.0 lib/potassium/recipes/i18n.rb
potassium-6.5.0 lib/potassium/recipes/i18n.rb
potassium-6.4.0 lib/potassium/recipes/i18n.rb
potassium-6.3.0 lib/potassium/recipes/i18n.rb
potassium-6.2.0 lib/potassium/recipes/i18n.rb
potassium-6.1.0 lib/potassium/recipes/i18n.rb
potassium-6.0.0 lib/potassium/recipes/i18n.rb
potassium-5.2.3 lib/potassium/recipes/i18n.rb
potassium-5.2.2 lib/potassium/recipes/i18n.rb
potassium-5.2.1 lib/potassium/recipes/i18n.rb
potassium-5.2.0 lib/potassium/recipes/i18n.rb