zci 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/zci +1 -1
- data/features/step_definitions/{fci_steps.rb → zci_steps.rb} +0 -0
- data/features/{fci.feature → zci.feature} +0 -0
- data/lib/zci/commands/04_export.rb +12 -8
- data/lib/zci/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: e64255b9f9cf12d6427bd07d7971eb173698d031
|
4
|
+
data.tar.gz: 331837a46c7d85598a6a58215da68d4a8243dc46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26da2d4cb8733f663e5398091d9cc708dc66479e14abf3a144fbfe47c1db8a715e132c5cce74a32d7b48de7f1d512b545ab089e10f9fc6fa7c86fd65420619d3
|
7
|
+
data.tar.gz: 1d08b2465ff2ba17c1e3683abd04182b66650799776fc193a49aa909d64fa58ba0967349c0821c3c1ed0560392ff9572479a47619fcc3247d08e458b844a4f82
|
data/bin/zci
CHANGED
@@ -59,7 +59,7 @@ pre do |global, command, options, args|
|
|
59
59
|
end
|
60
60
|
|
61
61
|
if global[:verbose]
|
62
|
-
Crowdin::API.log = Logger.new(STDOUT) if
|
62
|
+
Crowdin::API.log = Logger.new(STDOUT) if global[:verbose]
|
63
63
|
end
|
64
64
|
|
65
65
|
@crowdin = Crowdin::API.new(api_key: @cli_config['crowdin_api_key'], project_id: @cli_config['crowdin_project_id'], base_url: @cli_config['crowdin_base_url'])
|
File without changes
|
File without changes
|
@@ -40,13 +40,15 @@ command :'export:translations' do |c|
|
|
40
40
|
all_sections.each do |section_hash|
|
41
41
|
if section = sections.find(id: section_hash[:id])
|
42
42
|
if section_tr = section.translations.detect { |tr| tr.locale == locale.locale }
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
section_tr.update(name: section_hash[:name], description: section_hash[:description])
|
44
|
+
if section_tr.changed?
|
45
|
+
section_tr.save
|
46
|
+
puts "[Zendesk] Update `#{lang['crowdin_language_code']}` language translation for Section\##{section.id}."
|
47
|
+
end
|
46
48
|
else
|
47
|
-
puts "[Zendesk] Create `#{lang['crowdin_language_code']}` language translation for Section\##{section.id}."
|
48
49
|
section_tr = section.translations.build(locale: locale.locale, name: section_hash[:name], description: section_hash[:description])
|
49
50
|
section_tr.save
|
51
|
+
puts "[Zendesk] Create `#{lang['crowdin_language_code']}` language translation for Section\##{section.id}."
|
50
52
|
end
|
51
53
|
end
|
52
54
|
end
|
@@ -57,13 +59,15 @@ command :'export:translations' do |c|
|
|
57
59
|
if section = sections.find(id: article_hash[:section_id])
|
58
60
|
if article = section.articles.find(id: article_hash[:id])
|
59
61
|
if article_tr = article.translations.detect { |tr| tr.locale == locale.locale }
|
60
|
-
|
61
|
-
|
62
|
-
|
62
|
+
article_tr.update(title: article_hash[:title], body: article_hash[:body])
|
63
|
+
if article_tr.changed?
|
64
|
+
article_tr.save
|
65
|
+
puts "[Zendesk] Update `#{lang['crowdin_language_code']}` language translation for Article\##{article.id}."
|
66
|
+
end
|
63
67
|
else
|
64
|
-
puts "[Zendesk] Create `#{lang['crowdin_language_code']}` language translation for Article\##{article.id}."
|
65
68
|
article_tr = article.translations.build(locale: locale.locale, title: article_hash[:title], body: article_hash[:body])
|
66
69
|
article_tr.save
|
70
|
+
puts "[Zendesk] Create `#{lang['crowdin_language_code']}` language translation for Article\##{article.id}."
|
67
71
|
end
|
68
72
|
end
|
69
73
|
end
|
data/lib/zci/version.rb
CHANGED
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.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Maminov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -165,9 +165,9 @@ files:
|
|
165
165
|
- README.md
|
166
166
|
- Rakefile
|
167
167
|
- bin/zci
|
168
|
-
- features/
|
169
|
-
- features/step_definitions/fci_steps.rb
|
168
|
+
- features/step_definitions/zci_steps.rb
|
170
169
|
- features/support/env.rb
|
170
|
+
- features/zci.feature
|
171
171
|
- lib/zci.rb
|
172
172
|
- lib/zci/commands/01_init.rb
|
173
173
|
- lib/zci/commands/02_import.rb
|