ios_polyglot_cli 2.8.0 → 2.8.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 05bc2ec0c852881bc76b3db04ffc02c092b419310f75f9794f6599186dd3a27b
4
- data.tar.gz: 50b0bf737825bd918fb00d95cd08044cc0b54abfe47f3a1e36ac1ecc2e449cb2
3
+ metadata.gz: 8a2d3b371bed0807c83074709b3e4420f0683ad68a483e1eba2c7e14ef2c3d58
4
+ data.tar.gz: d48cfd6818d47164cf7cd2029562e5ea32618fb72262a86f748ef017aed5a6cb
5
5
  SHA512:
6
- metadata.gz: d00874d440dd388c9476744d0d24c8908beab14eb6df7a7ddd3f361159b950ff6c448a1c79abf0c975281eae3c66057199e874706bdf60a9542f6462e90c6aa3
7
- data.tar.gz: 2d5f9bb9917435720af5ca2014ab36882071bc301c672bc76f5fec69d2edad5cc152312ba18f53aea52c7606ed9d7a34c693154544c882fd42d80682dbd1daeb
6
+ metadata.gz: 9f5e2e3d56ee30417711581031eaf18a451d1884569cbd0383024969085b21270927f59f8c6369bebbfa7ecdc3b4b2189ccee13128c3dbd0dcf28f41650dbf6f
7
+ data.tar.gz: 2eb5ac2be00987cabaa96321744765313c021d6c4b9d95428db57abcc96dbe253d1f8ea3e393f867c723fc51e23ca18ed2b09f5dce7a57b655538b38234fea6a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ios_polyglot_cli (2.8.0)
4
+ ios_polyglot_cli (2.8.2)
5
5
  activesupport
6
6
  commander
7
7
  json_api_client
@@ -14,6 +14,10 @@ module PolyglotIos
14
14
  clean_variable_name(name)
15
15
  end
16
16
 
17
+ def [](key)
18
+ @attributes[key.to_s]
19
+ end
20
+
17
21
  end
18
22
  end
19
23
  end
@@ -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
- return {}
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]}, ABORTING!!!")
49
- return false
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
@@ -37,7 +37,7 @@ public struct Strings: Hashable, ExpressibleByStringLiteral, StringsProtocol, Se
37
37
 
38
38
  public protocol StringsProtocol: RawRepresentable {
39
39
  var localized: String { get }
40
- func localized(with args: CVarArg...) -> String
40
+ func localized(with args: any CVarArg...) -> String
41
41
  }
42
42
 
43
43
  public extension StringsProtocol where RawValue == String {
@@ -45,7 +45,7 @@ public extension StringsProtocol where RawValue == String {
45
45
  return self.rawValue.localized
46
46
  }
47
47
 
48
- func localized(with args: CVarArg...) -> String {
48
+ func localized(with args: any CVarArg...) -> String {
49
49
  return String(format: self.rawValue.localized, arguments: args)
50
50
  }
51
51
  }
@@ -1,3 +1,3 @@
1
1
  module PolyglotIos
2
- VERSION = '2.8.0'
2
+ VERSION = '2.8.2'
3
3
  end
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.0
4
+ version: 2.8.2
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-01-17 00:00:00.000000000 Z
11
+ date: 2025-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler