fastlane-plugin-google_sheet_localize 0.1.53 → 0.1.54

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: 2a7d528e3b37439408fac46e0ffa0b8333d96218bc1c2ee7af088c24334299ea
4
- data.tar.gz: 49ebc9a48a3bbc18bcd0bdcb6fa17f4a8798f97c177a6116726553a43ca87523
3
+ metadata.gz: ca0a7c8b39bcba4562285f0e04b78d18985d058b02fa3190906827ca08a05034
4
+ data.tar.gz: f542192380763fd64fdc22f4a7ec5e6f72e62aa396789814db2025824ab84cb6
5
5
  SHA512:
6
- metadata.gz: 313ca30506ecbf00d8f097b4d407c7d336189db720d5ec578bd6beb6ad5ccb22e3edcbd50bb982b7b003d28bc25cdb0781982c94ec267cf994493b4a47abbe1b
7
- data.tar.gz: ebd480d82d2922db489d870d2d8f766c10184cc472adda808239083d822b7bbd39991ba2ec66ce8834e8d623a89b56c01136348892a35a245730c5d29c53dc08
6
+ metadata.gz: 414d513e932c344facd9321d59985ad186d101ced91709294694be4a5189b1c660493b04d3be7a81172c247bad8652705201d6ccc2dd60c3284506bdbf703721
7
+ data.tar.gz: fe0f35acc913ef7f3e3adb4848173d689a855cf51238d240ca45ec8ce52a902ce6ec832db448ee0d8f364bca8f5d537fba143611f80a20a729536e7709947040
@@ -13,39 +13,39 @@ module Fastlane
13
13
  tabs = params[:tabs]
14
14
  platform = params[:platform]
15
15
  path = params[:localization_path]
16
+ language_titles = params[:language_titles]
16
17
 
17
18
  spreadsheet = session.spreadsheet_by_url(spreadsheet_id)
18
-
19
- # Get the first worksheet
20
19
  worksheet = spreadsheet.worksheets.first
21
20
 
22
- languages = self.numberOfLanguages(worksheet)
23
-
24
21
  result = []
25
22
 
26
- for i in 2..1+languages
23
+ for i in 0..worksheet.max_cols
24
+
27
25
  title = worksheet.rows[0][i]
28
26
 
29
- language = {
30
- 'language' => title,
31
- 'items' => []
32
- }
27
+ if language_titles.include?(title)
33
28
 
34
- filterdWorksheets = []
29
+ language = {
30
+ 'language' => title,
31
+ 'items' => []
32
+ }
35
33
 
36
- if tabs.count == 0
37
- filterdWorksheets = spreadsheet.worksheets
38
- else
39
- filterdWorksheets = spreadsheet.worksheets.select { |item| tabs.include?(item.title) }
40
- end
34
+ filterdWorksheets = []
41
35
 
42
- filterdWorksheets.each { |worksheet|
43
- contentRows = worksheet.rows.drop(1)
44
- language['items'].concat(self.generateJSONObject(contentRows, i))
45
- }
36
+ if tabs.count == 0
37
+ filterdWorksheets = spreadsheet.worksheets
38
+ else
39
+ filterdWorksheets = spreadsheet.worksheets.select { |item| tabs.include?(item.title) }
40
+ end
46
41
 
47
- result.push(language)
42
+ filterdWorksheets.each { |worksheet|
43
+ contentRows = worksheet.rows.drop(1)
44
+ language['items'].concat(self.generateJSONObject(contentRows, i))
45
+ }
48
46
 
47
+ result.push(language)
48
+ end
49
49
  end
50
50
  self.createFiles(result, platform, path)
51
51
  end
@@ -269,11 +269,6 @@ module Fastlane
269
269
  return filtered
270
270
  end
271
271
 
272
- def self.numberOfLanguages(worksheet)
273
- i = worksheet.num_cols
274
- return i - 3
275
- end
276
-
277
272
  def self.description
278
273
  "Creates .strings files for iOS and strings.xml files for Android"
279
274
  end
@@ -314,6 +309,11 @@ module Fastlane
314
309
  description: "Array of all Google Sheet Tabs",
315
310
  optional: false,
316
311
  type: Array),
312
+ FastlaneCore::ConfigItem.new(key: :language_titles,
313
+ env_name: "LANGUAGE_TITLES",
314
+ description: "Alle language titles",
315
+ optional: false,
316
+ type: Array),
317
317
  FastlaneCore::ConfigItem.new(key: :localization_path,
318
318
  env_name: "LOCALIZATION_PATH",
319
319
  description: "Output path",
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module GoogleSheetLocalize
3
- VERSION = "0.1.53"
3
+ VERSION = "0.1.54"
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.53
4
+ version: 0.1.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Hahn