bin/crowdin-cli in crowdin-cli-0.2.3 vs bin/crowdin-cli in crowdin-cli-0.2.4
- old
+ new
@@ -7,10 +7,11 @@
# GLI_DEBUG=true bundle exec bin/crowdin-cli
# Setup i18n
# tell the I18n library where to find your translations
I18n.load_path += Dir[Pathname(__FILE__).dirname.expand_path + '../locales/*.yml']
+I18n.enforce_available_locales = false
I18n.locale = :en
# Return +hierarchy+ of directories and files in Crowdin project
#
# +files+ - basically, it's project files details from API method `project_info`
@@ -305,13 +306,14 @@
if File.exist?(File.join(@base_path, file['source']))
dest = file['source']
dest_files << dest
local_file = { dest: dest, source: File.join(@base_path, file['source']), export_pattern: file['translation'] }
- # Used only when uploading CSV file to define data columns mapping
+
local_file.merge!({ sheme: file['scheme'] }) if file.has_key?('scheme')
local_file.merge!({ first_line_contains_header: file['first_line_contains_header'] }) if file.has_key?('first_line_contains_header')
+ local_file.merge!({ update_option: file['update_option'] }) if file.has_key?('update_option')
local_files << local_file
else
Find.find(@base_path) do |source_path|
dest = source_path.sub(@base_path, '') # relative path in Crowdin
@@ -328,11 +330,13 @@
dest_files << dest
export_pattern = construct_export_pattern(dest, file['source'], file['translation'])
local_file = { dest: dest, source: source_path, export_pattern: export_pattern }
+
local_file.merge!({ sheme: file['scheme'] }) if file.has_key?('scheme')
local_file.merge!({ first_line_contains_header: file['first_line_contains_header'] }) if file.has_key?('first_line_contains_header')
+ local_file.merge!({ update_option: file['update_option'] }) if file.has_key?('update_option')
local_files << local_file
end
end # Find