zci 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +4 -3
- data/bin/zci +2 -0
- data/lib/zci.rb +1 -0
- data/lib/zci/commands/04_export.rb +14 -2
- data/lib/zci/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74c68016fb98385348c5b0a2b9fc52bdd58dfa66
|
4
|
+
data.tar.gz: 115756f78c28fddda64e0063acafcaaf040d774c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51f091f825c13e88e02b77a04ee7597a315a04b6220141b0abd90462fecfeaecff0663bbdb05532a6bc99dad0852195b8b49eb69d64751ea59292b437497fe93
|
7
|
+
data.tar.gz: a7550fc239f3f23f5f04baf628329f57c6aa1eac74030acdac520173522004d802ade77f2771cf793e9a00d45a9d9433e0b71958225a7ab05dd04735aeef8d3d
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -46,7 +46,7 @@ SYNOPSIS
|
|
46
46
|
zci [global options] command [command options] [arguments...]
|
47
47
|
|
48
48
|
VERSION
|
49
|
-
0.
|
49
|
+
0.3.1
|
50
50
|
|
51
51
|
GLOBAL OPTIONS
|
52
52
|
-c, --config=<s> - Project-specific configuration file (default: /home/crowdin/zci.yml)
|
@@ -60,6 +60,7 @@ COMMANDS
|
|
60
60
|
import:sources - Read categories/section/articles from Zendesk and upload resource files to Crowdin
|
61
61
|
download:translations - Build and download translation resources from Crowdin
|
62
62
|
export:translations - Add or update localized resource files(categories, sections and articles) in Zendesk
|
63
|
+
project:info - Zendesk and Crowdin info
|
63
64
|
```
|
64
65
|
|
65
66
|
## Configuration
|
@@ -102,8 +103,8 @@ categories:
|
|
102
103
|
|
103
104
|
Tested with the following Ruby versions:
|
104
105
|
|
105
|
-
- MRI 2.2.3
|
106
|
-
-
|
106
|
+
- MRI 2.2.3 (Windows)
|
107
|
+
- MRI 2.4.1 (Linux/macOS)
|
107
108
|
|
108
109
|
## Contributing
|
109
110
|
|
data/bin/zci
CHANGED
data/lib/zci.rb
CHANGED
@@ -8,11 +8,23 @@ command :'export:translations' do |c|
|
|
8
8
|
c.arg_name 'dir'
|
9
9
|
c.flag [:resources_dir]
|
10
10
|
|
11
|
+
c.desc 'Defines what language upload translations to. By default translations will be uploaded for all languages'
|
12
|
+
c.default_value 'all'
|
13
|
+
c.arg_name 'language_code'
|
14
|
+
c.flag [:l, :language]
|
15
|
+
|
11
16
|
c.action do |global_options, options, args|
|
12
17
|
resources_dir = File.join(File.dirname(global_options[:config]), options[:resources_dir])
|
18
|
+
language = options[:language]
|
19
|
+
|
20
|
+
if language == 'all'
|
21
|
+
zendesk_locales = @zendesk.locales
|
22
|
+
else
|
23
|
+
zendesk_locales = @zendesk.locales.select { |locale| locale.locale == language }
|
24
|
+
end
|
13
25
|
|
14
26
|
@cli_config['categories'].each do |category|
|
15
|
-
|
27
|
+
zendesk_locales.select { |locale| !locale.default? }.each do |locale|
|
16
28
|
if lang = category['translations'].detect { |tr| tr['zendesk_locale'].casecmp(locale.locale) == 0 }
|
17
29
|
category_xml_files = Dir["#{resources_dir}/#{lang['crowdin_language_code']}/#{category['zendesk_category']}/category_*.xml"]
|
18
30
|
section_xml_files = Dir["#{resources_dir}/#{lang['crowdin_language_code']}/#{category['zendesk_category']}/section_*.xml"]
|
@@ -102,7 +114,7 @@ command :'export:translations' do |c|
|
|
102
114
|
end
|
103
115
|
|
104
116
|
end
|
105
|
-
end #
|
117
|
+
end # zendesk_locales
|
106
118
|
end # @cli_config['categories'].each
|
107
119
|
end
|
108
120
|
end
|
data/lib/zci/version.rb
CHANGED