forked from AckeeCZ/ACKLocalization
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Configuration.swift
59 lines (47 loc) · 2.17 KB
/
Configuration.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//
// Configuration.swift
//
//
// Created by Jakub Olejník on 11/12/2019.
//
import Foundation
public typealias LanguageMapping = [String: String]
/// Object representing app parameters
public struct Configuration: Decodable {
/// API key that will be used to comunicate with Google Sheets API
///
/// Either `apiKey` or `serviceAccount` must be provided, if both are provided, then `serviceAccount` will be used
public let apiKey: APIKey?
/// Path to destination directory where generated strings files should be saved
public let destinationDir: String
/// Name of column that contains keys to be localized
public let keyColumnName: String
/// Mapping of language column names to app languages
public let languageMapping: LanguageMapping
/// Path to service account file that will be used to access spreadsheet
///
/// Either `apiKey` or `serviceAccount` must be provided, if both are provided, then `serviceAccount` will be used
public let serviceAccount: String?
/// Identifier of spreadsheet that should be downloaded
public let spreadsheetID: String
/// Name of spreadsheet tab to be fetched
///
/// If nothing is specified, we will use the first tab in spreadsheet
public let spreadsheetTabName: String?
/// Name of strings file that should be generated
public let stringsFileName: String?
/// Name of stringsDict file that should be generated
public let stringsDictFileName: String?
public init(apiKey: APIKey?, destinationDir: String, keyColumnName: String, languageMapping: LanguageMapping, serviceAccount: String?,
spreadsheetID: String, spreadsheetTabName: String?, stringsFileName: String?, stringsDictFileName: String?) {
self.apiKey = apiKey
self.destinationDir = destinationDir
self.keyColumnName = keyColumnName
self.languageMapping = languageMapping
self.serviceAccount = serviceAccount
self.spreadsheetID = spreadsheetID
self.spreadsheetTabName = spreadsheetTabName
self.stringsFileName = stringsFileName
self.stringsDictFileName = stringsDictFileName
}
}