fastlane-plugin-google_sheet_localize 0.1.51 → 0.1.52

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: d17878398029568feb9ee6bd27af8636db4f8210f52c2a08dd07c90a4892586b
4
- data.tar.gz: 1dc64c0e36953f70154bb5c191695ea2fafa918d45947ff3bafd57f28e575bbc
3
+ metadata.gz: 5ea42ee15d69f1ce5642d240fc69e752a4df45ff8534a3eb6955444efaa7f4f5
4
+ data.tar.gz: 80c038a3a483ed00dfd06493f285cec855cbc08331a67d4e7cda56950b0f7a5c
5
5
  SHA512:
6
- metadata.gz: 4e683cd4c804e51b9b8617368afeeed0d2c19373d7c02fd7d659691d9193a11500632043b7e1077dd7b1ef4c6736262c58d996b35466cfd815c67e1410d22289
7
- data.tar.gz: 616c2f44afe6521c56900e861594767e906965ed7e7cf676210ef5a57d03fc0e5b346494df3c1001f40dc422aceb85495bac686ef3f60ed88d996f2365d58f75
6
+ metadata.gz: 5e3a4e3689d6503a434c003cd131453107e7373e0bab708804aea0c7d806929a97de2bf5bf9a6f969febd38d125257ea86e399b5bff17513c199a26bfe8e5e4e
7
+ data.tar.gz: 456392ad5dfb062cb610c11d860101e0839f43b67e21b70376ad749393ebc23a8ef0bbc16cab14fc60a53b8f4b400f1a4afaf39a71cd10d7dd8f5e541b82bd8a
@@ -175,12 +175,35 @@ module Fastlane
175
175
  end
176
176
 
177
177
  if platform == "android"
178
- FileUtils.mkdir_p "values-#{language['language']}"
179
- File.open("values-#{language['language']}/strings.xml", "w") do |f|
178
+ languageDir = language['language']
179
+
180
+ if languageDir == "en"
181
+ languageDir = "values"
182
+ else
183
+ languageDir = "values-#{languageDir}"
184
+ end
185
+
186
+ FileUtils.mkdir_p "#{destinationPath}/#{languageDir}"
187
+ File.open("#{destinationPath}/#{languageDir}/strings.xml", "w") do |f|
180
188
  f.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
181
189
  f.write("<resources>\n")
182
190
  language["items"].each { |item|
183
- f.write("\t<!--#{item['comment']}-->\n\t<string name=\"#{item['identifierAndroid']}\"><![CDATA[#{item['text']}]]></string>\n")
191
+
192
+ comment = item['comment']
193
+ identifier = item['identifierAndroid']
194
+ text = item['text']
195
+
196
+ if !identifier.to_s.empty? && identifier != "NR"
197
+ line = ""
198
+
199
+ if !comment.to_s.empty?
200
+ line = line + "\t<!--#{comment}-->\n"
201
+ end
202
+
203
+ line = line + "\t<string name=\"#{identifier}\"><![CDATA[#{text}]]></string>\n"
204
+
205
+ f.write(line)
206
+ end
184
207
  }
185
208
  f.write("</resources>\n")
186
209
  end
@@ -245,7 +268,7 @@ module Fastlane
245
268
  end
246
269
 
247
270
  def self.mapInvalidPlaceholder(text)
248
- filtered = text.gsub('%s', '%@')
271
+ filtered = text.gsub('%s', '%@').gsub('"', '\"')
249
272
  return filtered
250
273
  end
251
274
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module GoogleSheetLocalize
3
- VERSION = "0.1.51"
3
+ VERSION = "0.1.52"
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.51
4
+ version: 0.1.52
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Hahn