fastlane-plugin-google_sheet_localize 0.1.65 → 0.1.66

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: dd960a78580d9640fc20ac2f407610ba5a3f8ef55a70e095ad0848f161ee9333
4
- data.tar.gz: 862d31925356d7f6b125adc00600be00e9012b4f7a06d0a976bf92779696291d
3
+ metadata.gz: 5ce3f8bbf0ad1e96decca4d373fe7e3b218716d72e02d7d2fb02ac1c1f666efd
4
+ data.tar.gz: 0ecb546fd36c4f898210400be042305f0321f553e479f6460817056688508f85
5
5
  SHA512:
6
- metadata.gz: 815e6612d11f48427975d2b1c1f45709139d65b364d9fbdc905985ecec26ea5847faacd69c780581662ea1362adc7712e31a84bedd67519bfb376c1b0fb16b14
7
- data.tar.gz: c22e94b03b1606f0f64d592f2764b78d2845583644d1f2b2be6838f3fbcbb0585481a5f6f347910c9e82d4d2a1b3b1a0212176c479b3bff07812a8dec34bc032
6
+ metadata.gz: 02233a92fa1025e80dfb58faa30a18c6a64703d0fe9f0b38b55565bb7db3fa0db0b92bc1fbbb70a139295aca66b081b3569c19f63f76a027da93cd9b68f9704b
7
+ data.tar.gz: e03e1b0d270ef3e02a8bb5bc3ac720908634c813131b8f8575e14bbf4d4da403c9ef67a7446d0c73a2384be0dcb1fc07bbc91a65fa5a797fd4979f54e4af3718
@@ -15,6 +15,7 @@ module Fastlane
15
15
  path = params[:localization_path]
16
16
  language_titles = params[:language_titles]
17
17
  default_language = params[:default_language]
18
+ base_language = params[:base_language]
18
19
 
19
20
  spreadsheet = session.spreadsheet_by_url(spreadsheet_id)
20
21
  worksheet = spreadsheet.worksheets.first
@@ -48,7 +49,7 @@ module Fastlane
48
49
  result.push(language)
49
50
  end
50
51
  end
51
- self.createFiles(result, platform, path, default_language)
52
+ self.createFiles(result, platform, path, default_language, base_language)
52
53
  end
53
54
 
54
55
  def self.generateJSONObject(contentRows, index)
@@ -89,8 +90,8 @@ module Fastlane
89
90
  }
90
91
  end
91
92
 
92
- def self.createFiles(languages, platform, destinationPath, defaultLanguage)
93
- self.createFilesForLanguages(languages, platform, destinationPath, defaultLanguage)
93
+ def self.createFiles(languages, platform, destinationPath, defaultLanguage, base_language)
94
+ self.createFilesForLanguages(languages, platform, destinationPath, defaultLanguage, base_language)
94
95
 
95
96
  if platform == "ios"
96
97
 
@@ -137,7 +138,7 @@ module Fastlane
137
138
  end
138
139
  end
139
140
 
140
- def self.createFilesForLanguages(languages, platform, destinationPath, defaultLanguage)
141
+ def self.createFilesForLanguages(languages, platform, destinationPath, defaultLanguage, base_language)
141
142
 
142
143
  languages.each { |language|
143
144
 
@@ -146,8 +147,15 @@ module Fastlane
146
147
  filteredItems = self.filterUnusedRows(language["items"],'identifierIos')
147
148
 
148
149
  filename = "Localizable.strings"
149
- filepath = "#{destinationPath}/#{language['language']}.lproj/#{filename}"
150
- FileUtils.mkdir_p "#{destinationPath}/#{language['language']}.lproj"
150
+
151
+ languageName = language['language']
152
+
153
+ if languageName == base_language
154
+ languageName = "Base"
155
+ end
156
+
157
+ filepath = "#{destinationPath}/#{languageName}.lproj/#{filename}"
158
+ FileUtils.mkdir_p "#{destinationPath}/#{languageName}.lproj"
151
159
  File.open(filepath, "w") do |f|
152
160
  filteredItems.each_with_index { |item, index|
153
161
 
@@ -342,6 +350,11 @@ module Fastlane
342
350
  description: "Default Language",
343
351
  optional: false,
344
352
  type: String),
353
+ FastlaneCore::ConfigItem.new(key: :base_language,
354
+ env_name: "BASE_LANGUAGE",
355
+ description: "Base language for Xcode projects",
356
+ optional: true,
357
+ type: String),
345
358
  FastlaneCore::ConfigItem.new(key: :localization_path,
346
359
  env_name: "LOCALIZATION_PATH",
347
360
  description: "Output path",
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module GoogleSheetLocalize
3
- VERSION = "0.1.65"
3
+ VERSION = "0.1.66"
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.65
4
+ version: 0.1.66
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Hahn
@@ -17,7 +17,7 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
- type: :development
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements: