crowdin-cli 0.3.10 → 0.4.0
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 +25 -14
- data/lib/crowdin-cli/version.rb +1 -1
- 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: db3457e8bf2d5e010be9b8245bdcb9ad639147c5
|
4
|
+
data.tar.gz: 66abe1df295d6edfa31c234811e6ac4c250db8c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 949d59fc3963fca75ba3a88673ac44794b1b28e31967dedb3014ccd035fb1428c7b18489d62dc498b638737180e4eb3aeb22472fe72416904434b3279e95813a
|
7
|
+
data.tar.gz: 6fd92ccf59aa5a3796809dc5b2f60023462ecba82fa9b5bd7d23cda0cc004f368d01d36016456147d0051afe6b39af314afc0ef802795e8823030237336e9e5e
|
data/bin/crowdin-cli
CHANGED
@@ -389,7 +389,7 @@ command :upload do |c|
|
|
389
389
|
local_files << local_file
|
390
390
|
else
|
391
391
|
Find.find(@base_path) do |source_path|
|
392
|
-
dest = source_path.sub(@base_path
|
392
|
+
dest = source_path.sub(/\A#{@base_path}/, '') # relative path in Crowdin
|
393
393
|
|
394
394
|
if File.directory?(source_path)
|
395
395
|
if ignores.any? { |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
@@ -557,7 +557,7 @@ EOS
|
|
557
557
|
end
|
558
558
|
|
559
559
|
if File.exists?(File.join(@base_path, file['source']))
|
560
|
-
dest = file['source'].sub(
|
560
|
+
dest = file['source'].sub(/\A#{@base_path}/, '')
|
561
561
|
dest_files << dest
|
562
562
|
|
563
563
|
file_translation_languages.each do |lang|
|
@@ -566,7 +566,7 @@ EOS
|
|
566
566
|
end
|
567
567
|
else
|
568
568
|
Find.find(@base_path) do |source_path|
|
569
|
-
dest = source_path.sub(@base_path
|
569
|
+
dest = source_path.sub(/\A#{@base_path}/, '') # relative path in Crowdin
|
570
570
|
|
571
571
|
if File.directory?(source_path)
|
572
572
|
if ignores.any? { |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
@@ -608,21 +608,23 @@ EOS
|
|
608
608
|
|
609
609
|
if remote_project_tree[:files].include?(file[:dest])
|
610
610
|
if File.exist?(file[:source])
|
611
|
-
print "Uploading translation file `#{file[:source].sub(@base_path
|
611
|
+
print "Uploading translation file `#{file[:source].sub(/\A#{@base_path}/, '')}'"
|
612
612
|
|
613
613
|
resp = @crowdin.upload_translation([] << file, language, params)
|
614
614
|
case resp['files'].first[1]
|
615
615
|
when 'skipped'
|
616
|
-
puts "\rUploading translation file `#{file[:source].sub(@base_path
|
616
|
+
puts "\rUploading translation file `#{file[:source].sub(/\A#{@base_path}/, '')}' - Skipped"
|
617
617
|
when 'uploaded'
|
618
|
-
puts "\rUploading translation file `#{file[:source].sub(@base_path
|
618
|
+
puts "\rUploading translation file `#{file[:source].sub(/\A#{@base_path}/, '')}' - OK"
|
619
|
+
when 'not_allowed'
|
620
|
+
puts "\rUploading translation file `#{file[:source].sub(/\A#{@base_path}/, '')}' - is not possible"
|
619
621
|
end
|
620
622
|
else
|
621
623
|
puts "Warning: Local file `#{file[:source]}' does not exist"
|
622
624
|
end
|
623
625
|
else
|
624
626
|
# if source file does not exist, don't upload translations
|
625
|
-
puts "Warning: Skip `#{file[:source].sub(@base_path
|
627
|
+
puts "Warning: Skip `#{file[:source].sub(/\A#{@base_path}/, '')}'"
|
626
628
|
end
|
627
629
|
end
|
628
630
|
end
|
@@ -667,7 +669,16 @@ command :download do |c|
|
|
667
669
|
end
|
668
670
|
|
669
671
|
# use export API method before to download the most recent translations
|
670
|
-
|
672
|
+
print 'Build ZIP archive with the latest translations '
|
673
|
+
export_translations = @crowdin.export_translations
|
674
|
+
if export_translations['success']
|
675
|
+
if export_translations['success']['status'] == 'built'
|
676
|
+
puts "- OK"
|
677
|
+
elsif export_translations['success']['status'] == 'skipped'
|
678
|
+
puts "- Skipped"
|
679
|
+
puts "Warning: Export was skipped. Please note that this method can be invoked only once per 30 minutes."
|
680
|
+
end
|
681
|
+
end
|
671
682
|
|
672
683
|
source_language = project_info['details']['source_language']['code']
|
673
684
|
source_language = supported_languages.find { |lang| lang['crowdin_code'] == source_language }
|
@@ -693,7 +704,7 @@ command :download do |c|
|
|
693
704
|
end
|
694
705
|
|
695
706
|
if File.exists?(File.join(@base_path, file['source']))
|
696
|
-
dest = file['source'].sub(
|
707
|
+
dest = file['source'].sub(/\A#{@base_path}/, '')
|
697
708
|
|
698
709
|
file_translation_languages.each do |lang|
|
699
710
|
zipped_file = export_pattern_to_path(dest, file['translation'], lang)
|
@@ -704,7 +715,7 @@ command :download do |c|
|
|
704
715
|
|
705
716
|
else
|
706
717
|
Find.find(@base_path) do |source_path|
|
707
|
-
dest = source_path.sub(@base_path
|
718
|
+
dest = source_path.sub(/\A#{@base_path}/, '') # relative path in Crowdin
|
708
719
|
|
709
720
|
if File.directory?(source_path)
|
710
721
|
if ignores.any? { |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
@@ -795,7 +806,7 @@ command :list do |ls_cmd|
|
|
795
806
|
local_files << local_file
|
796
807
|
else
|
797
808
|
Find.find(@base_path) do |source_path|
|
798
|
-
dest = source_path.sub(@base_path
|
809
|
+
dest = source_path.sub(/\A#{@base_path}/, '') # relative path in Crowdin
|
799
810
|
|
800
811
|
if File.directory?(source_path)
|
801
812
|
if ignores.any? { |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
@@ -856,7 +867,7 @@ command :list do |ls_cmd|
|
|
856
867
|
ignores = file['ignore'] || []
|
857
868
|
|
858
869
|
if File.exists?(File.join(@base_path, file['source']))
|
859
|
-
dest = file['source'].sub(
|
870
|
+
dest = file['source'].sub(/\A#{@base_path}/, '')
|
860
871
|
|
861
872
|
translation_languages.each do |lang|
|
862
873
|
local_file = export_pattern_to_path(dest, file['translation'], lang, languages_mapping)
|
@@ -865,7 +876,7 @@ command :list do |ls_cmd|
|
|
865
876
|
|
866
877
|
else
|
867
878
|
Find.find(@base_path) do |source_path|
|
868
|
-
dest = source_path.sub(@base_path
|
879
|
+
dest = source_path.sub(/\A#{@base_path}/, '') # relative path in Crowdin
|
869
880
|
|
870
881
|
if File.directory?(source_path)
|
871
882
|
if ignores.any? { |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
@@ -932,7 +943,7 @@ EOS
|
|
932
943
|
|
933
944
|
if File.exists?(globals[:identity])
|
934
945
|
identity = YAML.load_file(globals[:identity]) || {}
|
935
|
-
['api_key', 'project_identifier'].each do |key|
|
946
|
+
['api_key', 'project_identifier', 'base_path'].each do |key|
|
936
947
|
@config[key] = identity[key] if identity[key]
|
937
948
|
end
|
938
949
|
end
|
data/lib/crowdin-cli/version.rb
CHANGED
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
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Crowdin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-27 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.5
|
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.5
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: i18n
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|