Sha256: 1a8b455874b7e6c761329582d975090134e40acc7c25084ab2814fe26cbebec6

Contents?: true

Size: 872 Bytes

Versions: 21

Compression:

Stored size: 872 Bytes

Contents

desc 'Build and download translation resources from Crowdin'
command :'download:translations' do |c|
  c.desc 'Directory of resource files'
  c.long_desc <<-EOS.strip_heredoc
    This is the directory where the project's files will be store.
  EOS
  c.default_value 'resources'
  c.arg_name 'dir'
  c.flag [:resources_dir]

  c.action do |global_options, options, args|
    resources_dir = File.join(File.dirname(global_options[:config]), options[:resources_dir])

    language = 'all'
    tempfile = Tempfile.new(language)
    zipfile_name = tempfile.path

    begin
      export_translations!(@crowdin)

      puts 'Downloading translations'
      @crowdin.download_translation(language, output: zipfile_name)

      unzip_file_with_translations(zipfile_name, resources_dir)
    ensure
      tempfile.close
      tempfile.unlink # delete the tempfile
    end

  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
zci-0.11.0 lib/zci/commands/03_download.rb
zci-0.10.1 lib/zci/commands/03_download.rb
zci-0.10.0 lib/zci/commands/03_download.rb
zci-0.9.0 lib/zci/commands/03_download.rb
zci-0.8.0 lib/zci/commands/03_download.rb
zci-0.7.2 lib/zci/commands/03_download.rb
zci-0.7.1 lib/zci/commands/03_download.rb
zci-0.7.0 lib/zci/commands/03_download.rb
zci-0.6.1 lib/zci/commands/03_download.rb
zci-0.6.0 lib/zci/commands/03_download.rb
zci-0.5.0 lib/zci/commands/03_download.rb
zci-0.4.0 lib/zci/commands/03_download.rb
zci-0.3.1 lib/zci/commands/03_download.rb
zci-0.3.0 lib/zci/commands/03_download.rb
zci-0.2.0 lib/zci/commands/03_download.rb
zci-0.1.2 lib/zci/commands/03_download.rb
zci-0.1.1 lib/zci/commands/03_download.rb
zci-0.1.0 lib/zci/commands/03_download.rb
zci-0.0.5 lib/zci/commands/03_download.rb
zci-0.0.4 lib/zci/commands/03_download.rb