crowdin-cli 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/crowdin-cli +10 -7
- data/lib/crowdin-cli/version.rb +1 -1
- data/locales/en.yml +5 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1985e164f3be08bd1eb670bc0a620e1e5a819c28
|
4
|
+
data.tar.gz: 60553d3dda8f31bd5f65c8303bbee040d94cc719
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16d381d627e200f3a755ef186177998f50d1c943ab9b99116d68d1383ffa0f3276207fe1a477e272e443c7e88eefe4a33d01bf98ff5e3e0bbd0366258ee463dc
|
7
|
+
data.tar.gz: 72711904e7eaab0917e7fc82834b5a9cc71bc123171e9e256599e4e847a8e2e0f24820b55646d63f4b12b7145ceee40e38bbb0a8d4aff76bcccf66bc07084371
|
data/bin/crowdin-cli
CHANGED
@@ -240,7 +240,7 @@ end
|
|
240
240
|
# +files_list+ is a Hash of key-value pairs. Where key is a possible archive filename based on current project configuration
|
241
241
|
# and value is the expanded filename
|
242
242
|
#
|
243
|
-
def unzip_file_with_translations(zipfile_name, dest_path, files_list)
|
243
|
+
def unzip_file_with_translations(zipfile_name, dest_path, files_list, ignore_match)
|
244
244
|
# overwrite files if they already exist inside of the extracted path
|
245
245
|
Zip.on_exists_proc = true
|
246
246
|
|
@@ -254,7 +254,7 @@ def unzip_file_with_translations(zipfile_name, dest_path, files_list)
|
|
254
254
|
if file
|
255
255
|
fpath = File.join(dest_path, file)
|
256
256
|
FileUtils.mkdir_p(File.dirname(fpath))
|
257
|
-
puts "
|
257
|
+
puts "Extracting: `#{file}'"
|
258
258
|
zipfile.extract(f, fpath)
|
259
259
|
else
|
260
260
|
unmatched_files << f
|
@@ -262,10 +262,9 @@ def unzip_file_with_translations(zipfile_name, dest_path, files_list)
|
|
262
262
|
end
|
263
263
|
end
|
264
264
|
|
265
|
-
unless unmatched_files.empty?
|
266
|
-
puts "Warning: Downloaded translations do not match current project configuration.
|
265
|
+
unless unmatched_files.empty? or ignore_match
|
266
|
+
puts "Warning: Downloaded translations do not match current project configuration. The following files will be omitted:"
|
267
267
|
unmatched_files.each { |file| puts " - `#{file}'" }
|
268
|
-
puts "Crowdin has internal caching mechanisms that prevents us from overload. Please try to download translations later."
|
269
268
|
end
|
270
269
|
end
|
271
270
|
|
@@ -653,7 +652,11 @@ command :download do |c|
|
|
653
652
|
c.arg_name 'language_code'
|
654
653
|
c.flag [:l, :language], default_value: 'all'
|
655
654
|
|
656
|
-
c.
|
655
|
+
c.desc I18n.t('app.commands.download.switches.ignore_match.desc')
|
656
|
+
c.switch ['ignore-match'], negatable: false
|
657
|
+
|
658
|
+
|
659
|
+
c.action do |global_options, options, args|
|
657
660
|
language = options[:language]
|
658
661
|
|
659
662
|
supported_languages = @crowdin.supported_languages
|
@@ -756,7 +759,7 @@ command :download do |c|
|
|
756
759
|
begin
|
757
760
|
@crowdin.download_translation(language, output: zipfile_name)
|
758
761
|
|
759
|
-
unzip_file_with_translations(zipfile_name, @base_path, downloadable_files_hash)
|
762
|
+
unzip_file_with_translations(zipfile_name, @base_path, downloadable_files_hash, options['ignore-match'])
|
760
763
|
ensure
|
761
764
|
tempfile.close
|
762
765
|
tempfile.unlink # delete the tempfile
|
data/lib/crowdin-cli/version.rb
CHANGED
data/locales/en.yml
CHANGED
@@ -59,6 +59,11 @@ en:
|
|
59
59
|
desc: |
|
60
60
|
If the option is defined the translations will be downloaded for single specified language.
|
61
61
|
Othervice (by default) translations are downloaded for all languages
|
62
|
+
switches:
|
63
|
+
ignore_match:
|
64
|
+
desc: |
|
65
|
+
Exit with a zero even if no files matched
|
66
|
+
|
62
67
|
list:
|
63
68
|
desc: Show a list of files (the current project)
|
64
69
|
long_desc: |
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crowdin-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Crowdin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -89,7 +89,7 @@ dependencies:
|
|
89
89
|
version: '0.2'
|
90
90
|
- - ">="
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version: 0.2.
|
92
|
+
version: 0.2.6
|
93
93
|
type: :runtime
|
94
94
|
prerelease: false
|
95
95
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -99,7 +99,7 @@ dependencies:
|
|
99
99
|
version: '0.2'
|
100
100
|
- - ">="
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 0.2.
|
102
|
+
version: 0.2.6
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: i18n
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|