zci 0.8.0 → 0.9.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/LICENSE +1 -2
- data/lib/zci/commands/04_export.rb +36 -12
- data/lib/zci/version.rb +1 -1
- data/zci.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f32f7fca1037f13430c3511ae66f9987a8375cb1e7f251610b42f52e907c6d8
|
4
|
+
data.tar.gz: 6b3e4db195366251437b99790c57c4d9878a833438ea414070ca2cc1eb51af66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e062deb7306b44d5b44bdefc2f5d2331e3cc6c7743e434f186290accbae3b6e7f02ef7e691b3a0e20573d93f81f240dae887d71c09c55a6c3e06bb0fd07b2d9
|
7
|
+
data.tar.gz: 5f71793c9345bc4c119723e7f98a00df36b70b7f6acf3c84ccd1a0592f8d2d87e57be1599289e9ed1a72e346e02f53f7361678e8988c459def8f248fab3615ee
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2015-
|
3
|
+
Copyright (c) 2015-2019 Anton Maminov
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
SOFTWARE.
|
22
|
-
|
@@ -76,13 +76,21 @@ command :'export:translations' do |c|
|
|
76
76
|
if category_tr = category.translations.detect { |tr| tr.locale.casecmp(locale.locale) == 0 }
|
77
77
|
category_tr.update(title: category_hash[:name], body: category_hash[:description])
|
78
78
|
if category_tr.changed?
|
79
|
-
category_tr.save
|
80
|
-
|
79
|
+
if category_tr.save
|
80
|
+
puts "[Zendesk] Update `#{lang['crowdin_language_code']}` language translation for Category\##{category.id}."
|
81
|
+
else
|
82
|
+
puts "[Zendesk] Failed to update `#{lang['crowdin_language_code']}` language translation for Category\##{category.id}."
|
83
|
+
end
|
84
|
+
else
|
85
|
+
puts "[Zendesk] Skipping `#{lang['crowdin_language_code']}` language translation for Category\##{category.id}. Already up-to-date."
|
81
86
|
end
|
82
87
|
else
|
83
88
|
category_tr = category.translations.build(locale: locale.locale, title: category_hash[:name], body: category_hash[:description])
|
84
|
-
category_tr.save
|
85
|
-
|
89
|
+
if category_tr.save
|
90
|
+
puts "[Zendesk] Create `#{lang['crowdin_language_code']}` language translation for Category\##{category.id}."
|
91
|
+
else
|
92
|
+
puts "[Zendesk] Failed to create `#{lang['crowdin_language_code']}` language translation for Category\##{category.id}."
|
93
|
+
end
|
86
94
|
end
|
87
95
|
end
|
88
96
|
end
|
@@ -95,13 +103,21 @@ command :'export:translations' do |c|
|
|
95
103
|
if section_tr = section.translations.detect { |tr| tr.locale.casecmp(locale.locale) == 0 }
|
96
104
|
section_tr.update(title: section_hash[:name], body: section_hash[:description])
|
97
105
|
if section_tr.changed?
|
98
|
-
section_tr.save
|
99
|
-
|
106
|
+
if section_tr.save
|
107
|
+
puts "[Zendesk] Update `#{lang['crowdin_language_code']}` language translation for Section\##{section.id}."
|
108
|
+
else
|
109
|
+
puts "[Zendesk] Failed to update `#{lang['crowdin_language_code']}` language translation for Section\##{section.id}."
|
110
|
+
end
|
111
|
+
else
|
112
|
+
puts "[Zendesk] Skipping `#{lang['crowdin_language_code']}` language translation for Section\##{section.id}. Already up-to-date."
|
100
113
|
end
|
101
114
|
else
|
102
115
|
section_tr = section.translations.build(locale: locale.locale, title: section_hash[:name], body: section_hash[:description])
|
103
|
-
section_tr.save
|
104
|
-
|
116
|
+
if section_tr.save
|
117
|
+
puts "[Zendesk] Create `#{lang['crowdin_language_code']}` language translation for Section\##{section.id}."
|
118
|
+
else
|
119
|
+
puts "[Zendesk] Failed to create `#{lang['crowdin_language_code']}` language translation for Section\##{section.id}."
|
120
|
+
end
|
105
121
|
end
|
106
122
|
end
|
107
123
|
end
|
@@ -114,13 +130,21 @@ command :'export:translations' do |c|
|
|
114
130
|
if article_tr = article.translations.detect { |tr| tr.locale.casecmp(locale.locale) == 0 }
|
115
131
|
article_tr.update(title: article_hash[:title], body: article_hash[:body])
|
116
132
|
if article_tr.changed?
|
117
|
-
article_tr.save
|
118
|
-
|
133
|
+
if article_tr.save
|
134
|
+
puts "[Zendesk] Update `#{lang['crowdin_language_code']}` language translation for Article\##{article.id}."
|
135
|
+
else
|
136
|
+
puts "[Zendesk] Failed to update `#{lang['crowdin_language_code']}` language translation for Article\##{article.id}."
|
137
|
+
end
|
138
|
+
else
|
139
|
+
puts "[Zendesk] Skipping `#{lang['crowdin_language_code']}` language translation for Article\##{article.id}. Already up-to-date."
|
119
140
|
end
|
120
141
|
else
|
121
142
|
article_tr = article.translations.build(locale: locale.locale, draft: true, title: article_hash[:title], body: article_hash[:body])
|
122
|
-
article_tr.save
|
123
|
-
|
143
|
+
if article_tr.save
|
144
|
+
puts "[Zendesk] Create `#{lang['crowdin_language_code']}` language translation for Article\##{article.id}."
|
145
|
+
else
|
146
|
+
puts "[Zendesk] Failed to create `#{lang['crowdin_language_code']}` language translation for Article\##{article.id}."
|
147
|
+
end
|
124
148
|
end
|
125
149
|
end
|
126
150
|
end
|
data/lib/zci/version.rb
CHANGED
data/zci.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.add_runtime_dependency 'nokogiri', '~> 1.10'
|
17
17
|
s.add_runtime_dependency 'rubyzip', '~> 1.2'
|
18
18
|
s.add_runtime_dependency 'crowdin-api', '~> 0.5'
|
19
|
-
s.add_runtime_dependency 'zendesk_help_center_api', '~> 0.
|
19
|
+
s.add_runtime_dependency 'zendesk_help_center_api', '~> 0.7.0'
|
20
20
|
s.add_runtime_dependency 'gli', '~> 2.18'
|
21
21
|
s.add_development_dependency 'rake', '~> 12.3'
|
22
22
|
s.add_development_dependency 'rdoc', '~> 6.1'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zci
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Maminov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 0.7.0
|
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:
|
68
|
+
version: 0.7.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: gli
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|