ios_polyglot_cli 2.7.0 → 2.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4be5207295850180cb1f52a18f3506470d04835c814f149785521ddc00e1b6e0
4
- data.tar.gz: 5b4b4b0747330f635752b940098d914929185e5980c3b38e0b785b7bfa819596
3
+ metadata.gz: bb1b3ba2e4c4b1f8428e37df7c6d4376a96d2b2bec2c06730d73653d12e458e9
4
+ data.tar.gz: 561db605ad8a02dfb72bd2a55923888a5074d519451aceb49a35937681332b73
5
5
  SHA512:
6
- metadata.gz: 0c103fce180c3bc47dd740b54e09eff019ee3a1fe5323bb89b8231e5f4c02350dc50a7f631f0b8bcee0d1e5c6e420a975f8988b03abcb04957a02b5e18ed10a9
7
- data.tar.gz: 9cc61da2a0e77ebaaede23ed13599673ce96c59385de3cf80f5644ac8de6f87efae589208f51cc68b5ac46759333fd34fec5641c7496877501afb7bc7adf8a10
6
+ metadata.gz: f73b9b822d1f882fa3112ed1806a700972ee0bc4d986db3816cbfac4e51882bc1d09160c2f0d8e506c95c0076fdfc361d6ee44c9293ce682e2f13eb656766e5b
7
+ data.tar.gz: 8b46ceb5299a0655b902c8a009da44c0cd127cf377d9c06940d34a25e5eedadf83d3a8ca933d2aa47510924045035f90cea72bfaf14b11869a27d1c286509573
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ios_polyglot_cli (2.7.0)
4
+ ios_polyglot_cli (2.7.2)
5
5
  activesupport
6
6
  commander
7
7
  json_api_client
@@ -92,6 +92,7 @@ GEM
92
92
  zlib (3.2.0)
93
93
 
94
94
  PLATFORMS
95
+ arm64-darwin-22
95
96
  arm64-darwin-24
96
97
 
97
98
  DEPENDENCIES
@@ -109,7 +109,7 @@ module PolyglotIos
109
109
  prompt.say('Default language not found using first language')
110
110
  # use first language
111
111
  language = languages[0]
112
- prompt.say('Using first language')
112
+ prompt.say("Using first language #{language[:id]}")
113
113
  else
114
114
  prompt.say('Using default language')
115
115
  end
@@ -61,7 +61,9 @@ TEMPLATE
61
61
  next if key_name.nil?
62
62
  components = key_name.split(".")
63
63
  translation = @translations[key_name]
64
- root_enum.insert(components, key_name, translation)
64
+ if components && key_name && translation
65
+ root_enum.insert(components, key_name, translation)
66
+ end
65
67
  end
66
68
 
67
69
  return root_enum
@@ -21,11 +21,22 @@ module PolyglotIos
21
21
 
22
22
  def serializedDefaultTranslation()
23
23
  if !translation.nil?
24
- return "/// Value: #{translation}"
24
+ return format_translation_as_comment(translation)
25
25
  end
26
26
  return ""
27
27
  end
28
28
 
29
+ def format_translation_as_comment(translation)
30
+ lines = translation.lines
31
+ lines.each_with_index.map do |line, index|
32
+ if index == 0
33
+ "/// Value: #{line.chomp}"
34
+ else
35
+ "\t/// #{line.chomp}"
36
+ end
37
+ end.join("\n")
38
+ end
39
+
29
40
  end
30
41
  end
31
42
  end
@@ -17,7 +17,7 @@ module PolyglotIos
17
17
 
18
18
  def insert(components, key_name, translation)
19
19
  if components.count > 1
20
- insert_to_nested_enum(components, key_name)
20
+ insert_to_nested_enum(components, key_name, translation)
21
21
  elsif components.count == 1
22
22
  translation_case = TranslationCase.new(components.first, key_name, translation)
23
23
  translations.push(translation_case)
@@ -61,17 +61,17 @@ module PolyglotIos
61
61
 
62
62
  private
63
63
 
64
- def insert_to_nested_enum(components, key_name)
64
+ def insert_to_nested_enum(components, key_name, translation)
65
65
  _components = components.clone
66
66
 
67
67
  enum_name = _components.shift
68
68
  nested_enum = nested_enum_with_name(enum_name)
69
69
 
70
70
  if !nested_enum.nil?
71
- nested_enum.insert(_components, key_name)
71
+ nested_enum.insert(_components, key_name, translation)
72
72
  else
73
73
  child = TranslationEnum.new(enum_name)
74
- child.insert(_components, key_name)
74
+ child.insert(_components, key_name, translation)
75
75
  @child_enums.push(child)
76
76
  end
77
77
  end
@@ -1,3 +1,3 @@
1
1
  module PolyglotIos
2
- VERSION = '2.7.0'
2
+ VERSION = '2.7.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.7.0
4
+ version: 2.7.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: 2024-11-26 00:00:00.000000000 Z
11
+ date: 2024-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler