Sha256: 47c7eb142c6bf411046da3759aaeeb2a75c6a7124c070b38d6c6db14c0a52919

Contents?: true

Size: 923 Bytes

Versions: 10

Compression:

Stored size: 923 Bytes

Contents

module Pah
  module Templates
    class Locale < Pah::Template
      def call
        copy_static_file 'config/locales/pt-BR.yml'
        copy_static_file 'config/locales/app.pt-BR.yml'

        git add: 'config/locales/*.yml'
        git_commit 'Add pt-BR locale files.'

        time_zone_config = <<TIME_ZONE

    config.time_zone = ENV.fetch('TZ', 'Brasilia')
TIME_ZONE

        inject_into_file 'config/application.rb', time_zone_config,  after: "# config.time_zone = 'Central Time (US & Canada)'", verbose: false

        locale_config = <<LOCALE

    config.i18n.enforce_available_locales = true
    config.i18n.default_locale = :'pt-BR'
    config.i18n.locale = :'pt-BR'
LOCALE

        inject_into_file 'config/application.rb', locale_config,  after: '# config.i18n.default_locale = :de', verbose: false

        git add: 'config/application.rb'
        git_commit 'Add locale config.'
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pah-0.0.26 lib/pah/templates/locale.rb
pah-0.0.25 lib/pah/templates/locale.rb
pah-0.0.24 lib/pah/templates/locale.rb
pah-0.0.23 lib/pah/templates/locale.rb
pah-0.0.22 lib/pah/templates/locale.rb
pah-0.0.21 lib/pah/templates/locale.rb
pah-0.0.20 lib/pah/templates/locale.rb
pah-0.0.19 lib/pah/templates/locale.rb
pah-0.0.17 lib/pah/templates/locale.rb
pah-0.0.16 lib/pah/templates/locale.rb