Sha256: b717563b32a4690f925a7c4413b52ab6403f67bf670753226e879ba78cd89d04

Contents?: true

Size: 478 Bytes

Versions: 9

Compression:

Stored size: 478 Bytes

Contents

require 'i18n/tasks/base_task'

module I18n
  module Tasks
    class Prefill < BaseTask
      def perform
        # Will also rewrite en, good for ordering
        I18n.available_locales.map(&:to_s).each do |target_locale|
          trn = get_locale_data(target_locale)
          prefilled = { target_locale => base[base_locale] }.deep_merge(trn)
          File.open(locale_file_path(target_locale), 'w'){ |f| f.write prefilled.to_yaml }
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
i18n-tasks-0.1.1 lib/i18n/tasks/prefill.rb
i18n-tasks-0.1.0 lib/i18n/tasks/prefill.rb
i18n-tasks-0.0.8 lib/i18n/tasks/prefill.rb
i18n-tasks-0.0.7 lib/i18n/tasks/prefill.rb
i18n-tasks-0.0.6 lib/i18n/tasks/prefill.rb
i18n-tasks-0.0.5 lib/i18n/tasks/prefill.rb
i18n-tasks-0.0.4 lib/i18n/tasks/prefill.rb
i18n-tasks-0.0.3 lib/i18n/tasks/prefill.rb
i18n-tasks-0.0.2 lib/i18n/tasks/prefill.rb