fastlane-plugin-google_sheet_localize 0.1.99 → 0.2.0
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: dc76a11f3d9efb92d3a5b64fe692c5752a98cf27efaa9d66449b52683d4a1ffc
|
4
|
+
data.tar.gz: 3e4a4fe70a87277f917b639fab88c56c82f37042e3edc7f4cdb3d231df79900b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff3c79061b0eac4c9012123f3c6bb607b6b86c3d547230f0ee0558f61ce53df12b773fe3e39a6adb76724a57055e782d0392dfa1c7376e42a6768b813a7e6962
|
7
|
+
data.tar.gz: 812fff8313d088a1386ab84e96769bb4f9417fb6e550212e08b22d992cd3b385ac772122739d4aa05ce3b7b62bdd1891a410723c28874aee9d8e1d36735ff9a0
|
@@ -279,47 +279,45 @@ module Fastlane
|
|
279
279
|
identifier = item['identifierAndroid']
|
280
280
|
text = item['text']
|
281
281
|
|
282
|
-
|
283
|
-
line = ""
|
282
|
+
line = ""
|
284
283
|
|
285
|
-
|
286
|
-
|
287
|
-
|
284
|
+
if !comment.to_s.empty?
|
285
|
+
line = line + "\t<!--#{comment}-->\n"
|
286
|
+
end
|
288
287
|
|
289
|
-
|
290
|
-
|
291
|
-
|
288
|
+
if text == "" || text == "TBD"
|
289
|
+
default_language_object = languages.select { |languageItem| languageItem['language'] == defaultLanguage }.first["items"]
|
290
|
+
default_language_object = self.filterUnusedRows(default_language_object,'identifierAndroid')
|
292
291
|
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
292
|
+
defaultLanguageText = default_language_object[index]['text']
|
293
|
+
puts "found empty text for:\n\tidentifier: #{identifier}\n\tlanguage:#{language['language']}\n\treplacing it with: #{defaultLanguageText}"
|
294
|
+
text = defaultLanguageText
|
295
|
+
end
|
297
296
|
|
298
|
-
|
297
|
+
text = text.gsub(/\\?'/, "\\\\'")
|
299
298
|
|
300
|
-
|
299
|
+
if text.include?("one|")
|
301
300
|
|
302
|
-
|
301
|
+
text = text.gsub("\n", "|")
|
303
302
|
|
304
|
-
|
303
|
+
line = line + "\t<plurals name=\"#{identifier}\">\n"
|
305
304
|
|
306
|
-
|
305
|
+
plural = ""
|
307
306
|
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
end
|
320
|
-
|
321
|
-
f.write(line)
|
307
|
+
text.split("|").each_with_index { |word, wordIndex|
|
308
|
+
if wordIndex % 2 == 0
|
309
|
+
plural = "\t\t<item quantity=\"#{word}\">"
|
310
|
+
else
|
311
|
+
plural = plural + "<![CDATA[\"#{word}\"]]></item>\n"
|
312
|
+
line = line + plural
|
313
|
+
end
|
314
|
+
}
|
315
|
+
line = line + "\t</plurals>\n"
|
316
|
+
else
|
317
|
+
line = line + "\t<string name=\"#{identifier}\"><![CDATA[#{text}]]></string>\n"
|
322
318
|
end
|
319
|
+
|
320
|
+
f.write(line)
|
323
321
|
}
|
324
322
|
f.write("</resources>\n")
|
325
323
|
end
|
@@ -328,7 +326,7 @@ module Fastlane
|
|
328
326
|
end
|
329
327
|
|
330
328
|
def self.createiOSFileEndString()
|
331
|
-
return "\n\nprivate class LocalizationHelper { }\n\nextension Localization {\n\tprivate static func localized(identifier key: String, _ args: CVarArg...) -> String {\n\t\tlet format = NSLocalizedString(key, tableName: nil, bundle: Bundle(for: LocalizationHelper.self), comment: \"\")\n\n\t\tguard !args.isEmpty else { return format }\n\n\t\
|
329
|
+
return "\n\nprivate class LocalizationHelper { }\n\nextension Localization {\n\tprivate static func localized(identifier key: String, _ args: CVarArg...) -> String {\n\t\tlet format = NSLocalizedString(key, tableName: nil, bundle: Bundle(for: LocalizationHelper.self), comment: \"\")\n\n\t\tguard !args.isEmpty else { return format }\n\n\t\treturn String(format: format, locale: .current, arguments: args)\n\t}\n}"
|
332
330
|
end
|
333
331
|
|
334
332
|
def self.createiOSFunction(constantName, identifier, arguments, comment)
|