fastlane-plugin-google_sheet_localize 0.2.08 → 0.2.09
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: c02b39d49637a3b72336364ffd713da0ae15204ad348962f117c3f30b5422aad
|
4
|
+
data.tar.gz: dfd52c7a2444fce1704fcf33ff1f729857dad852b7246f56c793a6997ff3a404
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d4c5a96a6d0361096db40551b990f6a8de1a72c028df16aa27cc15d8ef6c6e4e4520a4e460f949b2c632fad2e64ed5d0ed6fed03d5b4ee8e9b098fe6a47cf05
|
7
|
+
data.tar.gz: a07b2c145f2a54eebe98dba7b201c401416cc9a3bd3fa023733f2a5431559f0908a846735da4b64525679f702ddf59a484874e580ee6328f7706b54050e03aa4
|
data/README.md
CHANGED
@@ -24,6 +24,16 @@ Google Drive access token: [_Guide_](https://medium.com/@osanda.deshan/getting-g
|
|
24
24
|
|
25
25
|
## Sheet Language
|
26
26
|
|
27
|
+
#### Arguments: (Android + iOS + Web)
|
28
|
+
English: `Mario ate a %2s %1s`.
|
29
|
+
German: `Mario hat %1s einen %2s gegessen`.
|
30
|
+
|
31
|
+
In this case `%2s` stands for __Apple__ and `%1s` for __Today__, the order is different in this example, so we need to take care of it.
|
32
|
+
|
33
|
+
Mapped iOS: `Mario ate a %2$@ %1$@`.
|
34
|
+
Mapped Android: `Mario ate a %2s %1s`.
|
35
|
+
Mapped Web: `Mario ate a {2} {1}`.
|
36
|
+
|
27
37
|
#### Plurals: (Android + iOS)
|
28
38
|
one|%d artist
|
29
39
|
other|%d artists
|
@@ -33,46 +33,54 @@ module Fastlane
|
|
33
33
|
end
|
34
34
|
|
35
35
|
spreadsheet = session.spreadsheet_by_url(spreadsheet_id)
|
36
|
-
worksheet = spreadsheet.worksheets.first
|
37
36
|
|
38
|
-
|
37
|
+
filterdWorksheets = []
|
39
38
|
|
40
|
-
|
39
|
+
if tabs.count == 0
|
40
|
+
filterdWorksheets = spreadsheet.worksheets
|
41
|
+
else
|
42
|
+
filterdWorksheets = spreadsheet.worksheets.select { |item| tabs.include?(item.title) }
|
43
|
+
end
|
41
44
|
|
42
|
-
|
45
|
+
result = []
|
46
|
+
|
47
|
+
filterdWorksheets.each { |worksheet|
|
43
48
|
|
44
|
-
|
49
|
+
identifierIndex = 0
|
45
50
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
51
|
+
for i in 0..worksheet.max_cols
|
52
|
+
if worksheet.rows[0][i] == identifier_name
|
53
|
+
identifierIndex = i
|
54
|
+
end
|
55
|
+
end
|
50
56
|
|
51
|
-
|
57
|
+
for i in 0..worksheet.max_cols
|
52
58
|
|
53
|
-
|
54
|
-
filterdWorksheets = spreadsheet.worksheets
|
55
|
-
else
|
56
|
-
filterdWorksheets = spreadsheet.worksheets.select { |item| tabs.include?(item.title) }
|
57
|
-
end
|
59
|
+
title = worksheet.rows[0][i]
|
58
60
|
|
59
|
-
|
60
|
-
identifierIndex = 0
|
61
|
+
if language_titles.include?(title)
|
61
62
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
63
|
+
language = result.select { |item| item['language'] == title }.first
|
64
|
+
|
65
|
+
if language.nil?
|
66
|
+
language = {
|
67
|
+
'language' => title,
|
68
|
+
'items' => []
|
69
|
+
}
|
66
70
|
end
|
67
71
|
|
68
72
|
contentRows = worksheet.rows.drop(1)
|
69
|
-
language['items'].concat(self.generateJSONObject(contentRows, i, identifierIndex))
|
70
|
-
}
|
71
73
|
|
72
|
-
|
74
|
+
items = language['items']
|
75
|
+
items = items + self.generateJSONObject(contentRows, i, identifierIndex)
|
76
|
+
|
77
|
+
language['items'] = items
|
78
|
+
|
79
|
+
result.push(language)
|
80
|
+
end
|
73
81
|
end
|
74
|
-
|
75
|
-
|
82
|
+
}
|
83
|
+
self.createFiles(result, platform, path, default_language, base_language, code_generation_path)
|
76
84
|
end
|
77
85
|
|
78
86
|
def self.generateJSONObject(contentRows, index, identifierIndex)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-google_sheet_localize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.09
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mario Hahn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google_drive
|