Reuse V shortcut for cell strings

This commit is contained in:
Davide De Rosa 2019-06-20 20:57:27 +02:00
parent 0aa66277ad
commit 4d81661cce
1 changed files with 15 additions and 15 deletions

View File

@ -246,19 +246,19 @@ extension ConfigurationViewController: UITableViewDataSource, UITableViewDelegat
cell.isTappable = isEditable cell.isTappable = isEditable
switch row { switch row {
case .cipher: case .cipher:
cell.leftText = L10n.Configuration.Cells.Cipher.caption cell.leftText = V.Cipher.caption
cell.rightText = configuration.fallbackCipher.description cell.rightText = configuration.fallbackCipher.description
case .digest: case .digest:
cell.leftText = L10n.Configuration.Cells.Digest.caption cell.leftText = V.Digest.caption
cell.rightText = configuration.fallbackDigest.description cell.rightText = configuration.fallbackDigest.description
case .compressionFraming: case .compressionFraming:
cell.leftText = L10n.Configuration.Cells.CompressionFraming.caption cell.leftText = V.CompressionFraming.caption
cell.rightText = configuration.fallbackCompressionFraming.cellDescription cell.rightText = configuration.fallbackCompressionFraming.cellDescription
case .compressionAlgorithm: case .compressionAlgorithm:
cell.leftText = L10n.Configuration.Cells.CompressionAlgorithm.caption cell.leftText = V.CompressionAlgorithm.caption
if let compressionAlgorithm = configuration.compressionAlgorithm { if let compressionAlgorithm = configuration.compressionAlgorithm {
cell.rightText = compressionAlgorithm.cellDescription cell.rightText = compressionAlgorithm.cellDescription
} else { } else {
@ -267,17 +267,17 @@ extension ConfigurationViewController: UITableViewDataSource, UITableViewDelegat
cell.isTappable = (configuration.compressionFraming != .disabled) cell.isTappable = (configuration.compressionFraming != .disabled)
case .resetOriginal: case .resetOriginal:
cell.leftText = L10n.Configuration.Cells.ResetOriginal.caption cell.leftText = V.ResetOriginal.caption
cell.applyAction(Theme.current) cell.applyAction(Theme.current)
case .client: case .client:
cell.leftText = L10n.Configuration.Cells.Client.caption cell.leftText = V.Client.caption
cell.rightText = (configuration.clientCertificate != nil) ? L10n.Configuration.Cells.Client.Value.enabled : L10n.Configuration.Cells.Client.Value.disabled cell.rightText = (configuration.clientCertificate != nil) ? V.Client.Value.enabled : V.Client.Value.disabled
cell.accessoryType = .none cell.accessoryType = .none
cell.isTappable = false cell.isTappable = false
case .tlsWrapping: case .tlsWrapping:
cell.leftText = L10n.Configuration.Cells.TlsWrapping.caption cell.leftText = V.TlsWrapping.caption
if let strategy = configuration.tlsWrap?.strategy { if let strategy = configuration.tlsWrap?.strategy {
switch strategy { switch strategy {
case .auth: case .auth:
@ -299,7 +299,7 @@ extension ConfigurationViewController: UITableViewDataSource, UITableViewDelegat
cell.isTappable = false cell.isTappable = false
case .defaultGateway: case .defaultGateway:
cell.leftText = L10n.Configuration.Cells.DefaultGateway.caption cell.leftText = V.DefaultGateway.caption
if let policies = configuration.routingPolicies { if let policies = configuration.routingPolicies {
cell.rightText = policies.map { $0.rawValue }.joined(separator: " / ") cell.rightText = policies.map { $0.rawValue }.joined(separator: " / ")
} else { } else {
@ -312,31 +312,31 @@ extension ConfigurationViewController: UITableViewDataSource, UITableViewDelegat
guard let dnsServers = configuration.dnsServers else { guard let dnsServers = configuration.dnsServers else {
fatalError("Showing DNS section without any custom server") fatalError("Showing DNS section without any custom server")
} }
cell.leftText = L10n.Configuration.Cells.DnsServer.caption cell.leftText = V.DnsServer.caption
cell.rightText = dnsServers[indexPath.row - 1] cell.rightText = dnsServers[indexPath.row - 1]
cell.accessoryType = .none cell.accessoryType = .none
cell.isTappable = false cell.isTappable = false
case .dnsDomain: case .dnsDomain:
cell.leftText = L10n.Configuration.Cells.DnsDomain.caption cell.leftText = V.DnsDomain.caption
cell.rightText = configuration.searchDomain ?? L10n.Global.Cells.none cell.rightText = configuration.searchDomain ?? L10n.Global.Cells.none
cell.accessoryType = .none cell.accessoryType = .none
cell.isTappable = false cell.isTappable = false
case .httpProxy: case .httpProxy:
cell.leftText = L10n.Configuration.Cells.ProxyHttp.caption cell.leftText = V.ProxyHttp.caption
cell.rightText = configuration.httpProxy?.description ?? L10n.Global.Cells.none cell.rightText = configuration.httpProxy?.description ?? L10n.Global.Cells.none
cell.accessoryType = .none cell.accessoryType = .none
cell.isTappable = false cell.isTappable = false
case .httpsProxy: case .httpsProxy:
cell.leftText = L10n.Configuration.Cells.ProxyHttps.caption cell.leftText = V.ProxyHttps.caption
cell.rightText = configuration.httpsProxy?.description ?? L10n.Global.Cells.none cell.rightText = configuration.httpsProxy?.description ?? L10n.Global.Cells.none
cell.accessoryType = .none cell.accessoryType = .none
cell.isTappable = false cell.isTappable = false
case .keepAlive: case .keepAlive:
cell.leftText = L10n.Configuration.Cells.KeepAlive.caption cell.leftText = V.KeepAlive.caption
if let keepAlive = configuration.keepAliveInterval, keepAlive > 0 { if let keepAlive = configuration.keepAliveInterval, keepAlive > 0 {
cell.rightText = V.KeepAlive.Value.seconds(Int(keepAlive)) cell.rightText = V.KeepAlive.Value.seconds(Int(keepAlive))
} else { } else {
@ -346,7 +346,7 @@ extension ConfigurationViewController: UITableViewDataSource, UITableViewDelegat
cell.isTappable = false cell.isTappable = false
case .renegSeconds: case .renegSeconds:
cell.leftText = L10n.Configuration.Cells.RenegotiationSeconds.caption cell.leftText = V.RenegotiationSeconds.caption
if let reneg = configuration.renegotiatesAfter, reneg > 0 { if let reneg = configuration.renegotiatesAfter, reneg > 0 {
cell.rightText = V.RenegotiationSeconds.Value.after(TimeInterval(reneg).localized) cell.rightText = V.RenegotiationSeconds.Value.after(TimeInterval(reneg).localized)
} else { } else {