bin/crowdin-cli in crowdin-cli-0.0.5 vs bin/crowdin-cli in crowdin-cli-0.0.6
- old
+ new
@@ -159,11 +159,10 @@
# Update existing files in Crowdin project
#
# array containing elements common to the two arrays
update_files = local_project_tree[:files] & remote_project_tree[:files]
files_for_upload = local_files.select{ |file| update_files.include?(file[:dest]) }
- files_for_upload.map{ |file| file.keep_if{ |k, v| [:source, :dest].include?(k) } }
files_for_upload.each do |file|
puts "Update file `#{file[:dest]}`"
@crowdin.update_file([] << file)
end
@@ -211,10 +210,10 @@
end
supported_languages = @crowdin.supported_languages
translation_languages = supported_languages.select{ |lang| project_languages.include?(lang['crowdin_code']) }
- source_language = 'en'
+ source_language = project_info['source_language']['code']
source_language = supported_languages.find{ |lang| lang['crowdin_code'] == source_language }
translated_files = Hash.new{ |hash, key| hash[key] = Array.new }
@config['files'].each do |file|