fastlane-plugin-google_sheet_localize 0.1.4 → 0.1.5

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: 49eed9cc0e4f96365e6d529f49e7b6a6b5a6271283d665cb57352e422e1ac2c6
4
- data.tar.gz: 79bf7132bcb483b6a6d807b8d304a917e437afd3eade322fa71f05765ebc217c
3
+ metadata.gz: 714e70705a464315aecdc814d690b1e5d2f926d9c7ff51c87270a6e7b1314441
4
+ data.tar.gz: d84410222307f26d577c3e8998dc97bb2bc2f6495585d3106c65b01cf32f24ed
5
5
  SHA512:
6
- metadata.gz: ab721931067e164440a3d5564c1c1e564a9087814342d8729f2c0d83669e32ecf30b3a7947894696616be130a6d144e0eed6d9d6eb9e6bdd50b0c2de238ad4e0
7
- data.tar.gz: 6ce7baf4d52d2705c5bc8718a5c833a8b58949c5be11e9a0fd7185423059cd4bf070adfd7aead1c648c7448e1405db1f36aa35140e087d3d3b7482b0de76ae95
6
+ metadata.gz: 7927ff4ab444a083e5d770214c6d65d5d2a99602279c08b3f1f7ff34d23b1976f6e028c16b86e670574f9a84d2dae3268ead22e8adebb3c8021777c295abd99c
7
+ data.tar.gz: f92f4e8907c7043f7fecf7f65d45002a619f425e9be73413dd8548c521023d10a5d43270725672d267aed47d103ba6ae56efebd710cee51d944e55b6fd50d1ea
@@ -95,8 +95,10 @@ module Fastlane
95
95
  swiftFilename = "Localization.swift"
96
96
  swiftFilepath = "#{destinationPath}/#{swiftFilename}"
97
97
 
98
- #removes all identififiers with the label Not Required
99
- filteredItems = languages[0]["items"].select { |item| item['identifierIos'] != "NR" }
98
+ filteredItems = languages[0]["items"].select { |item|
99
+ iosIdentifier = item['identifierIos']
100
+ iosIdentifier != "NR" && iosIdentifier != "" && !iosIdentifier.include?('//')
101
+ }
100
102
 
101
103
  File.open(swiftFilepath, "w") do |f|
102
104
  f.write("import Foundation\n\n\npublic struct Localization {\n")
@@ -139,8 +141,10 @@ module Fastlane
139
141
  swiftFilename = "Localization.swift"
140
142
  swiftFilepath = "#{destinationPath}/#{swiftFilename}"
141
143
 
142
- #removes all identififiers with the label Not Required
143
- filteredItems = language["items"].select { |item| item['identifierIos'] != "NR" }
144
+ filteredItems = language["items"].select { |item|
145
+ iosIdentifier = item['identifierIos']
146
+ iosIdentifier != "NR" && iosIdentifier != ""
147
+ }
144
148
 
145
149
  filename = "Localizable.strings"
146
150
  filepath = "#{destinationPath}/#{language['language']}.lproj/#{filename}"
@@ -149,8 +153,21 @@ module Fastlane
149
153
  filteredItems.each { |item|
150
154
 
151
155
  text = self.mapInvalidPlaceholder(item['text'])
156
+ comment = item['comment']
157
+ identifier = item['identifierIos']
158
+
159
+ line = ""
160
+
161
+ if identifier.include?('//')
162
+ line = "\n\n#{identifier}\n"
163
+ else
164
+ line = "\"#{identifier}\" = \"#{text}\";"
165
+ if !comment.to_s.empty?
166
+ line = line + " //#{comment}\n"
167
+ end
168
+ end
152
169
 
153
- f.write("//#{item['comment']}\n\"#{item['identifierIos']}\" = \"#{text}\";\n")
170
+ f.write(line)
154
171
  }
155
172
  end
156
173
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module GoogleSheetLocalize
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-google_sheet_localize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Hahn