crowdin-cli 0.2.5 → 0.3.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/README.md +20 -1
- data/bin/crowdin-cli +240 -35
- data/lib/crowdin-cli/version.rb +1 -1
- data/locales/en.yml +16 -0
- metadata +38 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 216c458d88118610633862f77abaa6eb06caa368
|
4
|
+
data.tar.gz: d4c1f9fbf06c86af5acc63236e7497123cdc3af8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e2aa85065201e87d38570523773133e69b8d68e9b36ef8e68dc98e4ca3408bb9ba4f06c79748deb6bb0ea065ca3f34da85a394dc08993d1d60ace63df06303f
|
7
|
+
data.tar.gz: 4ffea4b73f41a8ec0a1d8294eebb5d84284e8ba20fffb414645e9635a2cdfa3ed957c521c84acc4aeb85327debcc863f643151cbd3ea6debcbda6d6f6efef2b7
|
data/README.md
CHANGED
@@ -290,6 +290,25 @@ Download latest translations from Crowdin:
|
|
290
290
|
$ crowdin-cli download
|
291
291
|
```
|
292
292
|
|
293
|
+
List information about the files that already exists in current project:
|
294
|
+
```
|
295
|
+
$ crowdin-cli list project
|
296
|
+
```
|
297
|
+
|
298
|
+
List information about the sources files in current project that match the wild-card pattern:
|
299
|
+
```
|
300
|
+
$ crowdin-cli list sources
|
301
|
+
```
|
302
|
+
|
303
|
+
List information about the translations files in current project that match the wild-card pattern:
|
304
|
+
```
|
305
|
+
$ crowdin-cli list translations
|
306
|
+
```
|
307
|
+
|
308
|
+
By default, `list` command print a list of all the files
|
309
|
+
Also, `list` accept `-tree` optional argument to list contents in a tree-like format.
|
310
|
+
|
311
|
+
|
293
312
|
Get help on `upload` command:
|
294
313
|
```
|
295
314
|
$ crowdin-cli help upload
|
@@ -322,6 +341,6 @@ Tested with the following Ruby versions:
|
|
322
341
|
|
323
342
|
Author: Anton Maminov (anton.maminov@gmail.com)
|
324
343
|
|
325
|
-
Copyright: 2012-
|
344
|
+
Copyright: 2012-2014 [Crowdin.net](http://crowdin.net/)
|
326
345
|
|
327
346
|
This project is licensed under the MIT license, a copy of which can be found in the LICENSE file.
|
data/bin/crowdin-cli
CHANGED
@@ -79,7 +79,7 @@ def export_pattern_to_path(path, export_pattern, lang, languages_mapping = nil)
|
|
79
79
|
placeholders = pattern.inject([]){ |memo, h| memo << h.first[/%(.*)%/, 1] }
|
80
80
|
|
81
81
|
unless languages_mapping.nil?
|
82
|
-
pattern = Hash[pattern.map{ |placeholder, str| [
|
82
|
+
pattern = Hash[pattern.map { |placeholder, str| [
|
83
83
|
placeholder,
|
84
84
|
(languages_mapping[placeholder[/%(.*)%/, 1]][lang['crowdin_code']] rescue nil) || str]
|
85
85
|
}]
|
@@ -229,7 +229,6 @@ def unzip_file_with_translations(zipfile_name, dest_path, files_list)
|
|
229
229
|
|
230
230
|
Zip::File.open(zipfile_name) do |zipfile|
|
231
231
|
zipfile.select{ |zip_entry| zip_entry.file? }.each do |f|
|
232
|
-
# XXX
|
233
232
|
# `f' - relative path in archive
|
234
233
|
file = files_list[f.name]
|
235
234
|
if file
|
@@ -245,11 +244,60 @@ def unzip_file_with_translations(zipfile_name, dest_path, files_list)
|
|
245
244
|
|
246
245
|
unless unmatched_files.empty?
|
247
246
|
puts "Warning: Downloaded translations does not match current project configuration. Some of the resulted files will be omitted."
|
248
|
-
unmatched_files.each{ |file| puts " - `#{file}'" }
|
247
|
+
unmatched_files.each { |file| puts " - `#{file}'" }
|
249
248
|
puts "Crowdin has internal caching mechanisms that prevents us from overload. Please try to download translations later."
|
250
249
|
end
|
251
250
|
end
|
252
251
|
|
252
|
+
# Build a Hash tree from Array of +filenames*
|
253
|
+
#
|
254
|
+
def build_hash_tree(filenames)
|
255
|
+
files_tree = filenames.inject({}) { |h, i| t = h; i.split("/").each { |n| t[n] ||= {}; t = t[n] }; h }
|
256
|
+
end
|
257
|
+
|
258
|
+
# Box-drawing character - https://en.wikipedia.org/wiki/Box-drawing_character
|
259
|
+
# ├ └ ─ │
|
260
|
+
#
|
261
|
+
def display_tree(files_tree, level = -2, branches = [])
|
262
|
+
tab = ' ' * 4
|
263
|
+
level += 1
|
264
|
+
|
265
|
+
files_tree.each_with_index do |(key, val), index|
|
266
|
+
if val.empty? # this is a file
|
267
|
+
result = branches.take(level).inject('') { |s, i| s << (i == 1 ? '│ ': ' ') }
|
268
|
+
|
269
|
+
if index == files_tree.length - 1
|
270
|
+
# this is a last element
|
271
|
+
result << '└' + '── ' + key
|
272
|
+
else
|
273
|
+
result << '├' + '── ' + key
|
274
|
+
end
|
275
|
+
|
276
|
+
puts result
|
277
|
+
else # this is directory
|
278
|
+
if key == '' # root directory
|
279
|
+
result = '.'
|
280
|
+
else
|
281
|
+
result = branches.take(level).inject('') { |s, i| s << (i == 1 ? '│ ' : ' ') }
|
282
|
+
if index == files_tree.length - 1
|
283
|
+
# this is a last element
|
284
|
+
result << '└' + '── ' + key
|
285
|
+
|
286
|
+
branches[level] = 0
|
287
|
+
else
|
288
|
+
result << '├' + '── ' + key
|
289
|
+
|
290
|
+
branches[level] = 1
|
291
|
+
end
|
292
|
+
end
|
293
|
+
puts result
|
294
|
+
|
295
|
+
# recursion \(^_^)/
|
296
|
+
display_tree(val, level, branches)
|
297
|
+
end
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
253
301
|
###
|
254
302
|
include GLI::App
|
255
303
|
|
@@ -289,7 +337,7 @@ command :upload do |c|
|
|
289
337
|
|
290
338
|
# Crowdin supported languages list
|
291
339
|
supported_languages = @crowdin.supported_languages
|
292
|
-
source_language = supported_languages.find{ |lang| lang['crowdin_code'] == source_language }
|
340
|
+
source_language = supported_languages.find { |lang| lang['crowdin_code'] == source_language }
|
293
341
|
|
294
342
|
remote_project_tree = get_remote_files_hierarchy(project_info['files'])
|
295
343
|
|
@@ -319,13 +367,13 @@ command :upload do |c|
|
|
319
367
|
dest = source_path.sub(@base_path, '') # relative path in Crowdin
|
320
368
|
|
321
369
|
if File.directory?(source_path)
|
322
|
-
if ignores.any?{ |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
370
|
+
if ignores.any? { |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
323
371
|
Find.prune # Don't look any further into this directory
|
324
372
|
else
|
325
373
|
next
|
326
374
|
end
|
327
375
|
elsif File.fnmatch?(file['source'], dest, File::FNM_PATHNAME)
|
328
|
-
next if ignores.any?{ |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
376
|
+
next if ignores.any? { |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
329
377
|
|
330
378
|
dest_files << dest
|
331
379
|
|
@@ -354,9 +402,9 @@ EOS
|
|
354
402
|
|
355
403
|
common_dir = @preserve_hierarchy ? '' : find_common_directory_path(dest_files)
|
356
404
|
|
357
|
-
local_project_tree = get_local_files_hierarchy(local_files.collect{ |h| h[:dest].sub(common_dir, '') })
|
405
|
+
local_project_tree = get_local_files_hierarchy(local_files.collect { |h| h[:dest].sub(common_dir, '') })
|
358
406
|
|
359
|
-
local_files.each{ |file| file[:dest].sub!(common_dir, '') }
|
407
|
+
local_files.each { |file| file[:dest].sub!(common_dir, '') }
|
360
408
|
|
361
409
|
# Create directory tree
|
362
410
|
#
|
@@ -371,7 +419,7 @@ EOS
|
|
371
419
|
#
|
372
420
|
# array containing elements common to the two arrays
|
373
421
|
update_files = local_project_tree[:files] & remote_project_tree[:files]
|
374
|
-
files_for_upload = local_files.select{ |file| update_files.include?(file[:dest]) }
|
422
|
+
files_for_upload = local_files.select { |file| update_files.include?(file[:dest]) }
|
375
423
|
files_for_upload.each do |file|
|
376
424
|
print "Updating source file `#{file[:dest]}'"
|
377
425
|
|
@@ -394,7 +442,7 @@ EOS
|
|
394
442
|
# Add new files to Crowdin project
|
395
443
|
#
|
396
444
|
add_files = local_project_tree[:files] - remote_project_tree[:files]
|
397
|
-
files_for_add = local_files.select{ |file| add_files.include?(file[:dest]) }
|
445
|
+
files_for_add = local_files.select { |file| add_files.include?(file[:dest]) }
|
398
446
|
files_for_add.each do |file|
|
399
447
|
print "Uploading source file `#{file[:dest]}'"
|
400
448
|
|
@@ -408,7 +456,7 @@ EOS
|
|
408
456
|
end
|
409
457
|
|
410
458
|
end # action
|
411
|
-
end #
|
459
|
+
end # upload sources
|
412
460
|
|
413
461
|
c.desc I18n.t('app.commands.upload.commands.translations.desc')
|
414
462
|
c.long_desc I18n.t('app.commands.upload.commands.translations.long_desc')
|
@@ -440,8 +488,9 @@ EOS
|
|
440
488
|
|
441
489
|
remote_project_tree = get_remote_files_hierarchy(project_info['files'])
|
442
490
|
|
443
|
-
|
444
|
-
|
491
|
+
if language == 'all'
|
492
|
+
project_languages = project_info['languages'].collect { |h| h['code'] }
|
493
|
+
else
|
445
494
|
if project_languages.include?(language)
|
446
495
|
project_languages = [] << language
|
447
496
|
else
|
@@ -452,9 +501,9 @@ EOS
|
|
452
501
|
supported_languages = @crowdin.supported_languages
|
453
502
|
|
454
503
|
source_language = project_info['details']['source_language']['code']
|
455
|
-
source_language = supported_languages.find{ |lang| lang['crowdin_code'] == source_language }
|
504
|
+
source_language = supported_languages.find { |lang| lang['crowdin_code'] == source_language }
|
456
505
|
|
457
|
-
translation_languages = supported_languages.select{ |lang| project_languages.include?(lang['crowdin_code']) }
|
506
|
+
translation_languages = supported_languages.select { |lang| project_languages.include?(lang['crowdin_code']) }
|
458
507
|
|
459
508
|
translated_files = Hash.new{ |hash, key| hash[key] = Array.new }
|
460
509
|
dest_files = []
|
@@ -490,13 +539,13 @@ EOS
|
|
490
539
|
dest = source_path.sub(@base_path, '') # relative path in Crowdin
|
491
540
|
|
492
541
|
if File.directory?(source_path)
|
493
|
-
if ignores.any?{ |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
542
|
+
if ignores.any? { |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
494
543
|
Find.prune # Don't look any further into this directory
|
495
544
|
else
|
496
545
|
next
|
497
546
|
end
|
498
547
|
elsif File.fnmatch?(file['source'], dest, File::FNM_PATHNAME)
|
499
|
-
next if ignores.any?{ |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
548
|
+
next if ignores.any? { |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
500
549
|
|
501
550
|
dest_files << dest
|
502
551
|
|
@@ -549,15 +598,173 @@ EOS
|
|
549
598
|
end
|
550
599
|
|
551
600
|
end # action
|
552
|
-
end #
|
601
|
+
end # upload translations
|
553
602
|
|
554
603
|
end
|
555
604
|
|
605
|
+
desc I18n.t('app.commands.list.desc')
|
606
|
+
long_desc I18n.t('app.commands.list.long_desc')
|
607
|
+
command :list do |ls_cmd|
|
608
|
+
|
609
|
+
ls_cmd.desc I18n.t('app.commands.list.commands.project.desc')
|
610
|
+
ls_cmd.command :project do |proj_cmd|
|
611
|
+
proj_cmd.desc I18n.t('app.commands.list.switches.tree.desc')
|
612
|
+
proj_cmd.switch ['tree'], :negatable => false
|
613
|
+
|
614
|
+
proj_cmd.action do |global_options, options, args|
|
615
|
+
project_info = @crowdin.project_info
|
616
|
+
remote_project_tree = get_remote_files_hierarchy(project_info['files'])
|
617
|
+
|
618
|
+
if options[:tree]
|
619
|
+
tree = build_hash_tree(remote_project_tree[:files])
|
620
|
+
display_tree(tree)
|
621
|
+
else
|
622
|
+
puts remote_project_tree[:files]
|
623
|
+
end
|
624
|
+
end
|
625
|
+
end
|
626
|
+
|
627
|
+
ls_cmd.desc I18n.t('app.commands.list.commands.sources.desc')
|
628
|
+
ls_cmd.command :sources do |src_cmd|
|
629
|
+
src_cmd.desc I18n.t('app.commands.list.switches.tree.desc')
|
630
|
+
src_cmd.switch ['tree'], :negatable => false
|
631
|
+
|
632
|
+
src_cmd.action do |global_options, options, args|
|
633
|
+
local_files = []
|
634
|
+
dest_files = []
|
635
|
+
|
636
|
+
@config['files'].each do |file|
|
637
|
+
get_invalid_placeholders(file['translation']).each do |placeholder|
|
638
|
+
puts "Warning: #{placeholder} is not valid variable supported by Crowdin. See http://crowdin.net/page/cli-tool#configuration-file for more details."
|
639
|
+
end
|
640
|
+
|
641
|
+
ignores = file['ignore'] || []
|
642
|
+
|
643
|
+
if File.exist?(File.join(@base_path, file['source']))
|
644
|
+
dest = file['source']
|
645
|
+
dest_files << dest
|
646
|
+
|
647
|
+
local_file = { dest: dest, source: File.join(@base_path, file['source']), export_pattern: file['translation'] }
|
648
|
+
|
649
|
+
local_file.merge!({ sheme: file['scheme'] }) if file.has_key?('scheme')
|
650
|
+
local_file.merge!({ first_line_contains_header: file['first_line_contains_header'] }) if file.has_key?('first_line_contains_header')
|
651
|
+
local_file.merge!({ update_option: file['update_option'] }) if file.has_key?('update_option')
|
652
|
+
|
653
|
+
local_files << local_file
|
654
|
+
else
|
655
|
+
Find.find(@base_path) do |source_path|
|
656
|
+
dest = source_path.sub(@base_path, '') # relative path in Crowdin
|
657
|
+
|
658
|
+
if File.directory?(source_path)
|
659
|
+
if ignores.any? { |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
660
|
+
Find.prune # Don't look any further into this directory
|
661
|
+
else
|
662
|
+
next
|
663
|
+
end
|
664
|
+
elsif File.fnmatch?(file['source'], dest, File::FNM_PATHNAME)
|
665
|
+
next if ignores.any? { |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
666
|
+
|
667
|
+
dest_files << dest
|
668
|
+
|
669
|
+
export_pattern = construct_export_pattern(dest, file['source'], file['translation'])
|
670
|
+
|
671
|
+
local_file = { dest: dest, source: source_path, export_pattern: export_pattern }
|
672
|
+
|
673
|
+
local_file.merge!({ sheme: file['scheme'] }) if file.has_key?('scheme')
|
674
|
+
local_file.merge!({ first_line_contains_header: file['first_line_contains_header'] }) if file.has_key?('first_line_contains_header')
|
675
|
+
local_file.merge!({ update_option: file['update_option'] }) if file.has_key?('update_option')
|
676
|
+
|
677
|
+
local_files << local_file
|
678
|
+
end
|
679
|
+
end # Find
|
680
|
+
|
681
|
+
end # if File.exists?
|
682
|
+
end # @config['files']
|
683
|
+
|
684
|
+
common_dir = @preserve_hierarchy ? '' : find_common_directory_path(dest_files)
|
685
|
+
|
686
|
+
local_project_tree = get_local_files_hierarchy(local_files.collect { |h| h[:dest].sub(common_dir, '') })
|
687
|
+
|
688
|
+
if options[:tree]
|
689
|
+
tree = build_hash_tree(local_project_tree[:files])
|
690
|
+
display_tree(tree)
|
691
|
+
else
|
692
|
+
puts local_project_tree[:files]
|
693
|
+
end
|
694
|
+
end
|
695
|
+
end # list sources
|
696
|
+
|
697
|
+
ls_cmd.desc I18n.t('app.commands.list.commands.translations.desc')
|
698
|
+
ls_cmd.command :translations do |trans_cmd|
|
699
|
+
trans_cmd.desc I18n.t('app.commands.list.switches.tree.desc')
|
700
|
+
trans_cmd.switch ['tree'], :negatable => false
|
701
|
+
|
702
|
+
trans_cmd.action do |global_options, options, args|
|
703
|
+
project_info = @crowdin.project_info
|
704
|
+
|
705
|
+
project_languages = project_info['languages'].collect{ |h| h['code'] }
|
706
|
+
|
707
|
+
supported_languages = @crowdin.supported_languages
|
708
|
+
translation_languages = supported_languages.select { |lang| project_languages.include?(lang['crowdin_code']) }
|
709
|
+
|
710
|
+
translation_files = []
|
711
|
+
@config['files'].each do |file|
|
712
|
+
languages_mapping = file['languages_mapping'] # Hash or NilClass
|
713
|
+
|
714
|
+
ignores = file['ignore'] || []
|
715
|
+
|
716
|
+
if File.exists?(File.join(@base_path, file['source']))
|
717
|
+
dest = file['source'].sub("#{@base_path}", '')
|
718
|
+
|
719
|
+
translation_languages.each do |lang|
|
720
|
+
local_file = export_pattern_to_path(dest, file['translation'], lang, languages_mapping)
|
721
|
+
translations_files << local_file
|
722
|
+
end
|
723
|
+
|
724
|
+
else
|
725
|
+
Find.find(@base_path) do |source_path|
|
726
|
+
dest = source_path.sub(@base_path, '') # relative path in Crowdin
|
727
|
+
|
728
|
+
if File.directory?(source_path)
|
729
|
+
if ignores.any? { |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
730
|
+
Find.prune # Don't look any further into this directory
|
731
|
+
else
|
732
|
+
next
|
733
|
+
end
|
734
|
+
elsif File.fnmatch?(file['source'], dest, File::FNM_PATHNAME)
|
735
|
+
next if ignores.any? { |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
736
|
+
|
737
|
+
export_pattern = construct_export_pattern(dest, file['source'], file['translation'])
|
738
|
+
|
739
|
+
translation_languages.each do |lang|
|
740
|
+
local_file = export_pattern_to_path(dest, export_pattern, lang, languages_mapping)
|
741
|
+
translation_files << local_file
|
742
|
+
end
|
743
|
+
|
744
|
+
end
|
745
|
+
end # Find
|
746
|
+
end # if
|
747
|
+
end # @config['files']
|
748
|
+
|
749
|
+
if options[:tree]
|
750
|
+
tree = build_hash_tree(translation_files)
|
751
|
+
display_tree(tree)
|
752
|
+
else
|
753
|
+
puts translation_files
|
754
|
+
end
|
755
|
+
|
756
|
+
end
|
757
|
+
end # list translations
|
758
|
+
|
759
|
+
#ls_cmd.default_command :project
|
760
|
+
end # list
|
761
|
+
|
556
762
|
desc I18n.t('app.commands.download.desc')
|
557
763
|
#arg_name 'Describe arguments to download here'
|
558
764
|
command :download do |c|
|
559
765
|
|
560
766
|
c.desc I18n.t('app.commands.download.flags.language.desc')
|
767
|
+
c.long_desc I18n.t('app.commands.download.flags.language.long_desc')
|
561
768
|
c.arg_name 'language_code'
|
562
769
|
c.flag [:l, :language], :default_value => 'all'
|
563
770
|
|
@@ -568,19 +775,17 @@ command :download do |c|
|
|
568
775
|
|
569
776
|
project_info = @crowdin.project_info
|
570
777
|
|
571
|
-
|
572
|
-
|
573
|
-
project_languages = project_info['languages'].collect{ |h| h['code'] }
|
778
|
+
if language == 'all'
|
779
|
+
project_languages = project_info['languages'].collect{ |h| h['code'] }
|
574
780
|
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
781
|
+
if @jipt_language
|
782
|
+
if supported_languages.find { |lang| lang['crowdin_code'] == @jipt_language }
|
783
|
+
project_languages << @jipt_language # crowdin_language_code
|
784
|
+
else
|
785
|
+
exit_now!("invalid jipt language `#{@jipt_language}`")
|
786
|
+
end
|
580
787
|
end
|
581
|
-
|
582
|
-
|
583
|
-
if language != 'all'
|
788
|
+
else
|
584
789
|
if project_languages.include?(language)
|
585
790
|
project_languages = [] << language
|
586
791
|
else
|
@@ -592,9 +797,9 @@ command :download do |c|
|
|
592
797
|
@crowdin.export_translations
|
593
798
|
|
594
799
|
source_language = project_info['details']['source_language']['code']
|
595
|
-
source_language = supported_languages.find{ |lang| lang['crowdin_code'] == source_language }
|
800
|
+
source_language = supported_languages.find { |lang| lang['crowdin_code'] == source_language }
|
596
801
|
|
597
|
-
translation_languages = supported_languages.select{ |lang| project_languages.include?(lang['crowdin_code']) }
|
802
|
+
translation_languages = supported_languages.select { |lang| project_languages.include?(lang['crowdin_code']) }
|
598
803
|
|
599
804
|
# keys is all possible files in .ZIP archive
|
600
805
|
# values is resulted local files
|
@@ -629,13 +834,13 @@ command :download do |c|
|
|
629
834
|
dest = source_path.sub(@base_path, '') # relative path in Crowdin
|
630
835
|
|
631
836
|
if File.directory?(source_path)
|
632
|
-
if ignores.any?{ |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
837
|
+
if ignores.any? { |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
633
838
|
Find.prune # Don't look any further into this directory
|
634
839
|
else
|
635
840
|
next
|
636
841
|
end
|
637
842
|
elsif File.fnmatch?(file['source'], dest, File::FNM_PATHNAME)
|
638
|
-
next if ignores.any?{ |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
843
|
+
next if ignores.any? { |pattern| File.fnmatch?(pattern, dest, File::FNM_PATHNAME) }
|
639
844
|
|
640
845
|
export_pattern = construct_export_pattern(dest, file['source'], file['translation'])
|
641
846
|
|
@@ -662,9 +867,9 @@ command :download do |c|
|
|
662
867
|
tempfile.close
|
663
868
|
tempfile.unlink # delete the tempfile
|
664
869
|
end
|
665
|
-
end
|
666
870
|
|
667
|
-
end
|
871
|
+
end # action
|
872
|
+
end # download
|
668
873
|
|
669
874
|
pre do |globals ,command, options, args|
|
670
875
|
# Pre logic here
|
data/lib/crowdin-cli/version.rb
CHANGED
data/locales/en.yml
CHANGED
@@ -50,8 +50,24 @@ en:
|
|
50
50
|
desc: Automatically approve uploaded translations
|
51
51
|
download:
|
52
52
|
desc: Download latest translations from Crowdin and put them to the right places in your project
|
53
|
+
long_desc: |
|
54
|
+
Download latest translations from Crowdin and put them to the right places in your project
|
53
55
|
flags:
|
54
56
|
language:
|
55
57
|
desc: |
|
56
58
|
If the option is defined the translations will be downloaded for single specified language.
|
57
59
|
Othervice (by default) translations are downloaded for all languages
|
60
|
+
list:
|
61
|
+
desc: Show a list of files (the current project)
|
62
|
+
long_desc: |
|
63
|
+
List information about the files. List only those files that match the wild-card pattern
|
64
|
+
commands:
|
65
|
+
project:
|
66
|
+
desc: List information about the files that already exists in current project
|
67
|
+
sources:
|
68
|
+
desc: List information about the sources files in current project that match the wild-card pattern
|
69
|
+
translations:
|
70
|
+
desc: List information about the translations files in current project that match the wild-card pattern
|
71
|
+
switches:
|
72
|
+
tree:
|
73
|
+
desc: list contents of directories in a tree-like format
|
metadata
CHANGED
@@ -1,111 +1,123 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crowdin-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Crowdin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rdoc
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: aruba
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: gli
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2.
|
61
|
+
version: '2.9'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 2.
|
68
|
+
version: '2.9'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rubyzip
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.0
|
75
|
+
version: '1.0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.0
|
82
|
+
version: '1.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: crowdin-api
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.2'
|
90
|
+
- - ">="
|
88
91
|
- !ruby/object:Gem::Version
|
89
92
|
version: 0.2.0
|
90
93
|
type: :runtime
|
91
94
|
prerelease: false
|
92
95
|
version_requirements: !ruby/object:Gem::Requirement
|
93
96
|
requirements:
|
94
|
-
- -
|
97
|
+
- - "~>"
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0.2'
|
100
|
+
- - ">="
|
95
101
|
- !ruby/object:Gem::Version
|
96
102
|
version: 0.2.0
|
97
103
|
- !ruby/object:Gem::Dependency
|
98
104
|
name: i18n
|
99
105
|
requirement: !ruby/object:Gem::Requirement
|
100
106
|
requirements:
|
101
|
-
- -
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0.6'
|
110
|
+
- - ">="
|
102
111
|
- !ruby/object:Gem::Version
|
103
112
|
version: 0.6.4
|
104
113
|
type: :runtime
|
105
114
|
prerelease: false
|
106
115
|
version_requirements: !ruby/object:Gem::Requirement
|
107
116
|
requirements:
|
108
|
-
- -
|
117
|
+
- - "~>"
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0.6'
|
120
|
+
- - ">="
|
109
121
|
- !ruby/object:Gem::Version
|
110
122
|
version: 0.6.4
|
111
123
|
description: A command-line interface to sync files between your computer/server and
|
@@ -117,12 +129,12 @@ executables:
|
|
117
129
|
extensions: []
|
118
130
|
extra_rdoc_files: []
|
119
131
|
files:
|
132
|
+
- LICENSE
|
133
|
+
- README.md
|
120
134
|
- bin/crowdin-cli
|
121
|
-
- lib/crowdin-cli/version.rb
|
122
135
|
- lib/crowdin-cli.rb
|
136
|
+
- lib/crowdin-cli/version.rb
|
123
137
|
- locales/en.yml
|
124
|
-
- README.md
|
125
|
-
- LICENSE
|
126
138
|
homepage: https://github.com/crowdin/crowdin-cli/
|
127
139
|
licenses:
|
128
140
|
- LICENSE
|
@@ -134,17 +146,17 @@ require_paths:
|
|
134
146
|
- lib
|
135
147
|
required_ruby_version: !ruby/object:Gem::Requirement
|
136
148
|
requirements:
|
137
|
-
- -
|
149
|
+
- - ">="
|
138
150
|
- !ruby/object:Gem::Version
|
139
151
|
version: 1.9.3
|
140
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
153
|
requirements:
|
142
|
-
- -
|
154
|
+
- - ">="
|
143
155
|
- !ruby/object:Gem::Version
|
144
156
|
version: '0'
|
145
157
|
requirements: []
|
146
158
|
rubyforge_project:
|
147
|
-
rubygems_version: 2.1
|
159
|
+
rubygems_version: 2.2.0.rc.1
|
148
160
|
signing_key:
|
149
161
|
specification_version: 4
|
150
162
|
summary: Crowdin CLI.
|