zci 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zci/commands/04_export.rb +11 -11
- 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: 1e2e47535e24607540dbaa78957a6ded07ef5ada
|
4
|
+
data.tar.gz: db9355627bb752f968873332dfe7b440833b369a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb79ce8ae9b1261a806dae5d8b59e8ce4ba5cf7f9616ba6eedcbf022eec2b7fee4f3aa02267fd2a112ef31fc97f55b73a0c7e76bf52f4a890510804d78c33e28
|
7
|
+
data.tar.gz: a85f5b013af3b1cbda039cf701e5aef5470e2b296daf5c8bc5d5ec9a91fef74f7a5f3f0aee649ad605539385e59921d9368921a14ed70570f628d54e4b95343b
|
@@ -23,12 +23,12 @@ command :'export:translations' do |c|
|
|
23
23
|
zendesk_locales = @zendesk.locales.select { |locale| locale.locale == language }
|
24
24
|
end
|
25
25
|
|
26
|
-
@cli_config['categories'].each do |
|
26
|
+
@cli_config['categories'].each do |category_section|
|
27
27
|
zendesk_locales.select { |locale| !locale.default? }.each do |locale|
|
28
|
-
if lang =
|
29
|
-
category_xml_files = Dir["#{resources_dir}/#{lang['crowdin_language_code']}/#{
|
30
|
-
section_xml_files = Dir["#{resources_dir}/#{lang['crowdin_language_code']}/#{
|
31
|
-
article_xml_files = Dir["#{resources_dir}/#{lang['crowdin_language_code']}/#{
|
28
|
+
if lang = category_section['translations'].detect { |tr| tr['zendesk_locale'].casecmp(locale.locale) == 0 }
|
29
|
+
category_xml_files = Dir["#{resources_dir}/#{lang['crowdin_language_code']}/#{category_section['zendesk_category']}/category_*.xml"]
|
30
|
+
section_xml_files = Dir["#{resources_dir}/#{lang['crowdin_language_code']}/#{category_section['zendesk_category']}/section_*.xml"]
|
31
|
+
article_xml_files = Dir["#{resources_dir}/#{lang['crowdin_language_code']}/#{category_section['zendesk_category']}/article_*.xml"]
|
32
32
|
|
33
33
|
all_categories = []
|
34
34
|
all_sections = []
|
@@ -37,22 +37,22 @@ command :'export:translations' do |c|
|
|
37
37
|
# Read categories from XML files
|
38
38
|
category_xml_files.each do |file|
|
39
39
|
category_xml_file = File.read(file)
|
40
|
-
|
41
|
-
all_categories <<
|
40
|
+
category_xml = parse_category_xml(category_xml_file)
|
41
|
+
all_categories << category_xml
|
42
42
|
end
|
43
43
|
|
44
44
|
# Read sections from XML files
|
45
45
|
section_xml_files.each do |file|
|
46
46
|
section_xml_file = File.read(file)
|
47
|
-
|
48
|
-
all_sections <<
|
47
|
+
section_xml = parse_section_xml(section_xml_file)
|
48
|
+
all_sections << section_xml
|
49
49
|
end
|
50
50
|
|
51
51
|
# Read articles from XML filse
|
52
52
|
article_xml_files.each do |file|
|
53
53
|
article_xml_file = File.read(file)
|
54
|
-
|
55
|
-
all_articles <<
|
54
|
+
article_xml = parse_article_xml(article_xml_file)
|
55
|
+
all_articles << article_xml
|
56
56
|
end
|
57
57
|
|
58
58
|
### Categories
|
data/lib/zci/version.rb
CHANGED