Sha256: 0d0ce03107302cc7565ddc37ea5eae79401566c6b330357caa76e48dcc24efd9

Contents?: true

Size: 543 Bytes

Versions: 11

Compression:

Stored size: 543 Bytes

Contents

namespace :localeapp do
  desc 'Imports the en.yml file to the LocaleServer'
  task :import => :environment do
    require 'flatten'
    include I18n::Backend::Flatten
    yml = YAML.load_file(ENV['LOCALE_FILE'])

    yml.each do |locale, translations|
      flatten_translations(
        locale,
        translations,
        I18n::Backend::Flatten::SEPARATOR_ESCAPE_CHAR,
        nil
      ).each do |key, value|
        puts "#{key} => #{value}"
        Localeapp.sender.post_translation(locale, key, {}, value)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
localeapp-0.4.1 lib/localeapp/tasks/localeapp.rake
localeapp-0.4.0 lib/localeapp/tasks/localeapp.rake
localeapp-0.3.2 lib/localeapp/tasks/localeapp.rake
localeapp-0.3.1 lib/localeapp/tasks/localeapp.rake
localeapp-0.3.0 lib/localeapp/tasks/localeapp.rake
localeapp-0.2.0 lib/localeapp/tasks/localeapp.rake
localeapp-0.1.2 lib/localeapp/tasks/localeapp.rake
localeapp-0.1.1 lib/localeapp/tasks/localeapp.rake
localeapp-0.0.11 lib/localeapp/tasks/localeapp.rake
localeapp-0.0.10 lib/localeapp/tasks/localeapp.rake
localeapp-0.0.8 lib/localeapp/tasks/localeapp.rake