ios_polyglot_cli 2.8.0 → 2.8.1
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/Gemfile.lock +1 -1
- data/lib/ios_polyglot_cli/api/language.rb +4 -0
- data/lib/ios_polyglot_cli/commands/pull.rb +17 -6
- data/lib/ios_polyglot_cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3374881eeb767e53761655ffe1d720b48ee2a7f3b3e323e0b732c9809583c027
|
4
|
+
data.tar.gz: e283c2b7386f09bd40ccb435d0194d5703ccb624b20fac030fdb8b7fc5795582
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0247f84e318ac505a3fa6c596d0177f7e8ba7f37336e041480b12c58f6abb73315bd2afe1a5a44609fc7bd08adf5a121cd642b66e47fcaa8757534e4bc7b8f55
|
7
|
+
data.tar.gz: 8a80dd1854c325bde438874ee825b8fe9052b0fcc68e8066ee522bd2a58040e911f21d1d1a8f3a7150e87fb2933bf35ff5dce719290af924d983db3826b8b3a7
|
data/Gemfile.lock
CHANGED
@@ -18,12 +18,17 @@ module PolyglotIos
|
|
18
18
|
prompt.say("Fetching translations...")
|
19
19
|
if generate_translations(project_configs, programming_language, skip_writing_language_struct)
|
20
20
|
success("Translations successfully generated!")
|
21
|
+
else
|
22
|
+
prompt.say("Some of the projects had issues, please check the logs.")
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
24
26
|
private
|
25
27
|
|
26
28
|
def generate_translations(projects, programming_language, skip_writing_language_struct)
|
29
|
+
|
30
|
+
returnValue = true
|
31
|
+
|
27
32
|
projects.each do |project|
|
28
33
|
project_id = project[:id]
|
29
34
|
project_fetched = pull_project(project_id)
|
@@ -34,19 +39,23 @@ module PolyglotIos
|
|
34
39
|
|
35
40
|
translations = {}
|
36
41
|
|
42
|
+
prompt.say("Generate translations for project: #{project_fetched[0][:name]}")
|
43
|
+
|
37
44
|
if !documentation_language.nil?
|
38
45
|
language = find_documentation_language(documentation_language, languages)
|
39
46
|
if language.nil?
|
40
|
-
prompt.say("ABORTED with reason: DocumentationLanguage must be correctly defined in the project configuration")
|
41
|
-
|
47
|
+
prompt.say("ABORTED with reason: DocumentationLanguage must be correctly defined in the project configuration, skipping project: #{project_fetched[0][:name]}")
|
48
|
+
returnValue = false
|
49
|
+
next
|
42
50
|
end
|
43
51
|
|
44
52
|
prompt.say("Found DocumentationLanguage: #{language[:name]}, documenting...")
|
45
53
|
translations = extract_translations_for_language(translation_keys, language)
|
46
54
|
|
47
55
|
if translations.empty?
|
48
|
-
prompt.say("No translations found for DocumentationLanguage: #{language[:name]},
|
49
|
-
|
56
|
+
prompt.say("No translations found for DocumentationLanguage: #{language[:name]}, skipping project: #{project_fetched[0][:name]}")
|
57
|
+
returnValue = false
|
58
|
+
next
|
50
59
|
end
|
51
60
|
else
|
52
61
|
language = find_default_language(default_language, languages)
|
@@ -66,8 +75,10 @@ module PolyglotIos
|
|
66
75
|
end
|
67
76
|
|
68
77
|
write_translation_sources(translation_keys, project[:sourceFilesPath], programming_language, translations)
|
69
|
-
return true
|
70
78
|
end
|
79
|
+
|
80
|
+
return returnValue
|
81
|
+
|
71
82
|
end
|
72
83
|
|
73
84
|
def extract_translations_for_language(translation_keys, language)
|
@@ -104,7 +115,7 @@ module PolyglotIos
|
|
104
115
|
def find_default_language(default_language, languages)
|
105
116
|
#find default language
|
106
117
|
prompt.say("Find default_language with id: = #{default_language}")
|
107
|
-
language = languages.find { |language| language[:id] == default_language }
|
118
|
+
language = languages.find { |language| language[:id].to_i == default_language }
|
108
119
|
if language.nil?
|
109
120
|
prompt.say('Default language not found using first language')
|
110
121
|
# use first language
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ios_polyglot_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.
|
4
|
+
version: 2.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Filip Gulan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|