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