fastlane-plugin-google_sheet_localize 0.1.4 → 0.1.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 714e70705a464315aecdc814d690b1e5d2f926d9c7ff51c87270a6e7b1314441
|
4
|
+
data.tar.gz: d84410222307f26d577c3e8998dc97bb2bc2f6495585d3106c65b01cf32f24ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
99
|
-
|
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
|
-
|
143
|
-
|
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(
|
170
|
+
f.write(line)
|
154
171
|
}
|
155
172
|
end
|
156
173
|
end
|