Localize strings in common

Move "Protocol" from macOS to Core.
This commit is contained in:
Davide De Rosa 2021-01-22 10:59:40 +01:00
parent 49dcbf2553
commit 0a9beaf8e0
8 changed files with 37 additions and 34 deletions

View File

@ -25,6 +25,7 @@
import Foundation
import TunnelKit
import PassepartoutCore
public protocol UIDescriptible {
var uiDescription: String { get }
@ -123,3 +124,33 @@ extension OpenVPN.ConfigurationBuilder {
return (randomizeEndpoint ?? false) ? V.enabled : V.disabled
}
}
extension NetworkChoice: CustomStringConvertible {
public var description: String {
switch self {
case .client:
return L10n.Core.NetworkChoice.client
case .server:
return L10n.Core.NetworkChoice.server
case .manual:
return L10n.Core.Global.Values.manual
}
}
}
extension DNSProtocol: CustomStringConvertible {
public var description: String {
switch self {
case .plain:
return "Cleartext"
case .https:
return "HTTPS"
case .tls:
return "TLS"
}
}
}

View File

@ -539,6 +539,8 @@ internal enum L10n {
internal static let address = L10n.tr("Core", "global.captions.address")
/// Port
internal static let port = L10n.tr("Core", "global.captions.port")
/// Protocol
internal static let `protocol` = L10n.tr("Core", "global.captions.protocol")
}
internal enum Host {
internal enum TitleInput {

View File

@ -713,18 +713,3 @@ extension NetworkSettingsViewController: FieldTableViewCellDelegate {
func fieldCellDidEnter(_: FieldTableViewCell) {
}
}
extension NetworkChoice: CustomStringConvertible {
public var description: String {
switch self {
case .client:
return L10n.Core.NetworkChoice.client
case .server:
return L10n.Core.NetworkChoice.server
case .manual:
return L10n.Core.Global.Values.manual
}
}
}

View File

@ -31,8 +31,6 @@ internal enum L10n {
internal enum Cells {
/// Address
internal static let address = L10n.tr("App", "endpoint.cells.address")
/// Protocol
internal static let `protocol` = L10n.tr("App", "endpoint.cells.protocol")
}
}
internal enum Menu {
@ -529,6 +527,8 @@ internal enum L10n {
internal static let address = L10n.tr("Core", "global.captions.address")
/// Port
internal static let port = L10n.tr("Core", "global.captions.port")
/// Protocol
internal static let `protocol` = L10n.tr("Core", "global.captions.protocol")
}
internal enum Host {
internal enum TitleInput {

View File

@ -77,21 +77,6 @@ extension PoolGroup {
}
}
extension NetworkChoice: CustomStringConvertible {
public var description: String {
switch self {
case .client:
return L10n.Core.NetworkChoice.client
case .server:
return L10n.Core.NetworkChoice.server
case .manual:
return L10n.Core.Global.Values.manual
}
}
}
extension String {
var image: NSImage? {
return ImageAsset(name: lowercased()).image

View File

@ -53,7 +53,7 @@ class EndpointViewController: NSViewController, ProfileCustomization {
super.viewDidLoad()
labelAddressCaption.stringValue = L10n.App.Endpoint.Cells.address.asCaption
labelProtocolCaption.stringValue = L10n.App.Endpoint.Cells.protocol.asCaption
labelProtocolCaption.stringValue = L10n.Core.Global.Captions.protocol.asCaption
popupAddress.removeAllItems()
for address in dataSource.addresses {

View File

@ -39,7 +39,6 @@
"service.cells.addresses.caption" = "Addresses";
"endpoint.cells.address" = "Address";
"endpoint.cells.protocol" = "Protocol";
"configuration.title" = "Configuration";
"configuration.alerts.commit.message" = "New parameters will not be effective until you reconnect manually. Changes in trusted networks will apply immediately.";

View File

@ -34,6 +34,7 @@
"global.captions.address" = "Address";
"global.captions.port" = "Port";
"global.captions.protocol" = "Protocol";
"global.values.enabled" = "Enabled";
"global.values.disabled" = "Disabled";