diff --git a/Passepartout-iOS/Global/SwiftGen+Scenes.swift b/Passepartout-iOS/Global/SwiftGen+Scenes.swift new file mode 100644 index 000000000..2c1779335 --- /dev/null +++ b/Passepartout-iOS/Global/SwiftGen+Scenes.swift @@ -0,0 +1,75 @@ +// swiftlint:disable all +// Generated using SwiftGen, by O.Halligon — https://github.com/SwiftGen/SwiftGen + +// swiftlint:disable sorted_imports +import Foundation +import UIKit + +// swiftlint:disable superfluous_disable_command +// swiftlint:disable file_length + +// MARK: - Storyboard Scenes + +// swiftlint:disable explicit_type_interface identifier_name line_length type_body_length type_name +internal enum StoryboardScene { + internal enum Main: StoryboardType { + internal static let storyboardName = "Main" + + internal static let initialScene = InitialSceneType(storyboard: Main.self) + + internal static let accountIdentifier = SceneType(storyboard: Main.self, identifier: "AccountIdentifier") + + internal static let configurationIdentifier = SceneType(storyboard: Main.self, identifier: "ConfigurationIdentifier") + + internal static let serviceIdentifier = SceneType(storyboard: Main.self, identifier: "ServiceIdentifier") + } + internal enum Organizer: StoryboardType { + internal static let storyboardName = "Organizer" + + internal static let initialScene = InitialSceneType(storyboard: Organizer.self) + + internal static let provider = SceneType(storyboard: Organizer.self, identifier: "Provider") + + internal static let wizardHostIdentifier = SceneType(storyboard: Organizer.self, identifier: "WizardHostIdentifier") + } +} +// swiftlint:enable explicit_type_interface identifier_name line_length type_body_length type_name + +// MARK: - Implementation Details + +internal protocol StoryboardType { + static var storyboardName: String { get } +} + +internal extension StoryboardType { + static var storyboard: UIStoryboard { + let name = self.storyboardName + return UIStoryboard(name: name, bundle: Bundle(for: BundleToken.self)) + } +} + +internal struct SceneType { + internal let storyboard: StoryboardType.Type + internal let identifier: String + + internal func instantiate() -> T { + let identifier = self.identifier + guard let controller = storyboard.storyboard.instantiateViewController(withIdentifier: identifier) as? T else { + fatalError("ViewController '\(identifier)' is not of the expected class \(T.self).") + } + return controller + } +} + +internal struct InitialSceneType { + internal let storyboard: StoryboardType.Type + + internal func instantiate() -> T { + guard let controller = storyboard.storyboard.instantiateInitialViewController() as? T else { + fatalError("ViewController is not of the expected class \(T.self).") + } + return controller + } +} + +private final class BundleToken {} diff --git a/Passepartout-iOS/Global/SwiftGen+Segues.swift b/Passepartout-iOS/Global/SwiftGen+Segues.swift new file mode 100644 index 000000000..f3493d063 --- /dev/null +++ b/Passepartout-iOS/Global/SwiftGen+Segues.swift @@ -0,0 +1,54 @@ +// swiftlint:disable all +// Generated using SwiftGen, by O.Halligon — https://github.com/SwiftGen/SwiftGen + +// swiftlint:disable sorted_imports +import Foundation +import UIKit + +// swiftlint:disable superfluous_disable_command +// swiftlint:disable file_length + +// MARK: - Storyboard Segues + +// swiftlint:disable explicit_type_interface identifier_name line_length type_body_length type_name +internal enum StoryboardSegue { + internal enum Main: String, SegueType { + case accountSegueIdentifier = "AccountSegueIdentifier" + case debugLogSegueIdentifier = "DebugLogSegueIdentifier" + case endpointSegueIdentifier = "EndpointSegueIdentifier" + case hostParametersSegueIdentifier = "HostParametersSegueIdentifier" + case providerPoolSegueIdentifier = "ProviderPoolSegueIdentifier" + case providerPresetSegueIdentifier = "ProviderPresetSegueIdentifier" + } + internal enum Organizer: String, SegueType { + case aboutSegueIdentifier = "AboutSegueIdentifier" + case addProviderSegueIdentifier = "AddProviderSegueIdentifier" + case creditsSegueIdentifier = "CreditsSegueIdentifier" + case disclaimerSegueIdentifier = "DisclaimerSegueIdentifier" + case importHostSegueIdentifier = "ImportHostSegueIdentifier" + case selectProfileSegueIdentifier = "SelectProfileSegueIdentifier" + case showImportedHostsSegueIdentifier = "ShowImportedHostsSegueIdentifier" + case versionSegueIdentifier = "VersionSegueIdentifier" + } +} +// swiftlint:enable explicit_type_interface identifier_name line_length type_body_length type_name + +// MARK: - Implementation Details + +internal protocol SegueType: RawRepresentable {} + +internal extension UIViewController { + func perform(segue: S, sender: Any? = nil) where S.RawValue == String { + let identifier = segue.rawValue + performSegue(withIdentifier: identifier, sender: sender) + } +} + +internal extension SegueType where RawValue == String { + init?(_ segue: UIStoryboardSegue) { + guard let identifier = segue.identifier else { return nil } + self.init(rawValue: identifier) + } +} + +private final class BundleToken {} diff --git a/Passepartout-iOS/Global/SwiftGen+Storyboards.swift b/Passepartout-iOS/Global/SwiftGen+Storyboards.swift deleted file mode 100644 index 5f85c8899..000000000 --- a/Passepartout-iOS/Global/SwiftGen+Storyboards.swift +++ /dev/null @@ -1,101 +0,0 @@ -// Generated using SwiftGen, by O.Halligon — https://github.com/SwiftGen/SwiftGen - -// swiftlint:disable sorted_imports -import Foundation -import UIKit -import Passepartout_iOS - -// swiftlint:disable superfluous_disable_command -// swiftlint:disable file_length - -internal protocol StoryboardType { - static var storyboardName: String { get } -} - -internal extension StoryboardType { - static var storyboard: UIStoryboard { - let name = self.storyboardName - return UIStoryboard(name: name, bundle: Bundle(for: BundleToken.self)) - } -} - -internal struct SceneType { - internal let storyboard: StoryboardType.Type - internal let identifier: String - - internal func instantiate() -> T { - let identifier = self.identifier - guard let controller = storyboard.storyboard.instantiateViewController(withIdentifier: identifier) as? T else { - fatalError("ViewController '\(identifier)' is not of the expected class \(T.self).") - } - return controller - } -} - -internal struct InitialSceneType { - internal let storyboard: StoryboardType.Type - - internal func instantiate() -> T { - guard let controller = storyboard.storyboard.instantiateInitialViewController() as? T else { - fatalError("ViewController is not of the expected class \(T.self).") - } - return controller - } -} - -internal protocol SegueType: RawRepresentable { } - -internal extension UIViewController { - func perform(segue: S, sender: Any? = nil) where S.RawValue == String { - let identifier = segue.rawValue - performSegue(withIdentifier: identifier, sender: sender) - } -} - -// swiftlint:disable explicit_type_interface identifier_name line_length type_body_length type_name -internal enum StoryboardScene { - internal enum Main: StoryboardType { - internal static let storyboardName = "Main" - - internal static let initialScene = InitialSceneType(storyboard: Main.self) - - internal static let accountIdentifier = SceneType(storyboard: Main.self, identifier: "AccountIdentifier") - - internal static let configurationIdentifier = SceneType(storyboard: Main.self, identifier: "ConfigurationIdentifier") - - internal static let serviceIdentifier = SceneType(storyboard: Main.self, identifier: "ServiceIdentifier") - } - internal enum Organizer: StoryboardType { - internal static let storyboardName = "Organizer" - - internal static let initialScene = InitialSceneType(storyboard: Organizer.self) - - internal static let provider = SceneType(storyboard: Organizer.self, identifier: "Provider") - - internal static let wizardHostIdentifier = SceneType(storyboard: Organizer.self, identifier: "WizardHostIdentifier") - } -} - -internal enum StoryboardSegue { - internal enum Main: String, SegueType { - case accountSegueIdentifier = "AccountSegueIdentifier" - case debugLogSegueIdentifier = "DebugLogSegueIdentifier" - case endpointSegueIdentifier = "EndpointSegueIdentifier" - case hostParametersSegueIdentifier = "HostParametersSegueIdentifier" - case providerPoolSegueIdentifier = "ProviderPoolSegueIdentifier" - case providerPresetSegueIdentifier = "ProviderPresetSegueIdentifier" - } - internal enum Organizer: String, SegueType { - case aboutSegueIdentifier = "AboutSegueIdentifier" - case addProviderSegueIdentifier = "AddProviderSegueIdentifier" - case creditsSegueIdentifier = "CreditsSegueIdentifier" - case disclaimerSegueIdentifier = "DisclaimerSegueIdentifier" - case importHostSegueIdentifier = "ImportHostSegueIdentifier" - case selectProfileSegueIdentifier = "SelectProfileSegueIdentifier" - case showImportedHostsSegueIdentifier = "ShowImportedHostsSegueIdentifier" - case versionSegueIdentifier = "VersionSegueIdentifier" - } -} -// swiftlint:enable explicit_type_interface identifier_name line_length type_body_length type_name - -private final class BundleToken {} diff --git a/Passepartout.xcodeproj/project.pbxproj b/Passepartout.xcodeproj/project.pbxproj index bd81e9bc8..83d59e4d7 100644 --- a/Passepartout.xcodeproj/project.pbxproj +++ b/Passepartout.xcodeproj/project.pbxproj @@ -9,7 +9,7 @@ /* Begin PBXBuildFile section */ 0E05C5D420D1645F006EE732 /* FieldTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E05C5CE20D139AF006EE732 /* FieldTableViewCell.swift */; }; 0E05C5D520D1645F006EE732 /* SettingTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ED824CD20D12DBE00F2FE9E /* SettingTableViewCell.swift */; }; - 0E05C5D620D1645F006EE732 /* SwiftGen+Storyboards.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EDE8DE320C89028004C739C /* SwiftGen+Storyboards.swift */; }; + 0E05C5D620D1645F006EE732 /* SwiftGen+Scenes.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EDE8DE320C89028004C739C /* SwiftGen+Scenes.swift */; }; 0E05C5D720D1645F006EE732 /* ToggleTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ED824C920D12B8700F2FE9E /* ToggleTableViewCell.swift */; }; 0E05C5DC20D198B9006EE732 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0E05C5DF20D198B9006EE732 /* Localizable.strings */; }; 0E05C5E420D1993C006EE732 /* SwiftGen+Strings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E05C5E320D1993C006EE732 /* SwiftGen+Strings.swift */; }; @@ -85,6 +85,7 @@ 0EDE8DE720C93945004C739C /* Credentials.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EDE8DE620C93945004C739C /* Credentials.swift */; }; 0EDE8DEE20C93E4C004C739C /* GroupConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EDE8DED20C93E4C004C739C /* GroupConstants.swift */; }; 0EE3BBB2215ED3A900F30952 /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EE3BBB1215ED3A900F30952 /* AboutViewController.swift */; }; + 0EF56BBB2185AC8500B0C8AB /* SwiftGen+Segues.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EF56BBA2185AC8500B0C8AB /* SwiftGen+Segues.swift */; }; 0EF5CF252141CE58004FF1BD /* HUD.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5CF242141CE58004FF1BD /* HUD.swift */; }; 0EF5CF292141F31F004FF1BD /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E4FD7ED20D539A0002221FF /* Utils.swift */; }; 0EFD943E215BE10800529B64 /* IssueReporter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EFD943D215BE10800529B64 /* IssueReporter.swift */; }; @@ -208,10 +209,11 @@ 0EDE8DC520C86910004C739C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 0EDE8DD220C86978004C739C /* NotificationCenter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NotificationCenter.framework; path = System/Library/Frameworks/NotificationCenter.framework; sourceTree = SDKROOT; }; 0EDE8DE220C86A13004C739C /* Passepartout.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Passepartout.entitlements; sourceTree = ""; }; - 0EDE8DE320C89028004C739C /* SwiftGen+Storyboards.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SwiftGen+Storyboards.swift"; sourceTree = ""; }; + 0EDE8DE320C89028004C739C /* SwiftGen+Scenes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SwiftGen+Scenes.swift"; sourceTree = ""; }; 0EDE8DE620C93945004C739C /* Credentials.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Credentials.swift; sourceTree = ""; }; 0EDE8DED20C93E4C004C739C /* GroupConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupConstants.swift; sourceTree = ""; }; 0EE3BBB1215ED3A900F30952 /* AboutViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = ""; }; + 0EF56BBA2185AC8500B0C8AB /* SwiftGen+Segues.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SwiftGen+Segues.swift"; sourceTree = ""; }; 0EF5CF242141CE58004FF1BD /* HUD.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HUD.swift; sourceTree = ""; }; 0EFD943D215BE10800529B64 /* IssueReporter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssueReporter.swift; sourceTree = ""; }; 0EFD943F215BED8E00529B64 /* LabelViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelViewController.swift; sourceTree = ""; }; @@ -441,7 +443,8 @@ 0E4FD7F020D58618002221FF /* Macros.swift */, 0ED38AE9214054A50004D387 /* OptionViewController.swift */, 0EA068F3218475F800C320AD /* ParsedFile+Alerts.swift */, - 0EDE8DE320C89028004C739C /* SwiftGen+Storyboards.swift */, + 0EDE8DE320C89028004C739C /* SwiftGen+Scenes.swift */, + 0EF56BBA2185AC8500B0C8AB /* SwiftGen+Segues.swift */, 0E05C61C20D27C82006EE732 /* Theme.swift */, 0ECEE44F20E1182E00A6BB43 /* Theme+Cells.swift */, 0E2B493F20FCFF990094784C /* Theme+Titles.swift */, @@ -827,11 +830,12 @@ 0E5E5DE2215119DD00E318A3 /* VPNConfiguration.swift in Sources */, 0EBE3AA0213DC1A100BFA2F5 /* ConnectionProfile.swift in Sources */, 0E1066C920E0F84A004F98B7 /* Cells.swift in Sources */, + 0EF56BBB2185AC8500B0C8AB /* SwiftGen+Segues.swift in Sources */, 0EBE3AA6213DC1B000BFA2F5 /* ProviderConnectionProfile.swift in Sources */, 0E3DA371215CB5BF00B40FC9 /* VersionViewController.swift in Sources */, 0EBBE8F52182361800106008 /* ConnectionService+Migration.swift in Sources */, 0E39BCF3214DA9310035E9DE /* AppConstants.swift in Sources */, - 0E05C5D620D1645F006EE732 /* SwiftGen+Storyboards.swift in Sources */, + 0E05C5D620D1645F006EE732 /* SwiftGen+Scenes.swift in Sources */, 0E2B494220FD16540094784C /* TransientStore.swift in Sources */, 0E89DFC5213DF7AE00741BA1 /* Preferences.swift in Sources */, 0E6BE13A20CFB76800A6DD36 /* ApplicationError.swift in Sources */, diff --git a/Passepartout/Sources/SwiftGen+Strings.swift b/Passepartout/Sources/SwiftGen+Strings.swift index cd9978442..e147cc262 100644 --- a/Passepartout/Sources/SwiftGen+Strings.swift +++ b/Passepartout/Sources/SwiftGen+Strings.swift @@ -1,3 +1,4 @@ +// swiftlint:disable all // Generated using SwiftGen, by O.Halligon — https://github.com/SwiftGen/SwiftGen import Foundation @@ -5,63 +6,54 @@ import Foundation // swiftlint:disable superfluous_disable_command // swiftlint:disable file_length -// swiftlint:disable explicit_type_interface identifier_name line_length nesting type_body_length type_name +// MARK: - Strings + +// swiftlint:disable explicit_type_interface function_parameter_count identifier_name line_length +// swiftlint:disable nesting type_body_length type_name internal enum L10n { internal enum About { /// About internal static let title = L10n.tr("Localizable", "about.title") - internal enum Cells { - internal enum JoinCommunity { /// Join community internal static let caption = L10n.tr("Localizable", "about.cells.join_community.caption") } - internal enum ShareGeneric { /// Invite a friend internal static let caption = L10n.tr("Localizable", "about.cells.share_generic.caption") } - internal enum ShareTwitter { /// Tweet about it! internal static let caption = L10n.tr("Localizable", "about.cells.share_twitter.caption") } - internal enum Version { /// Version internal static let caption = L10n.tr("Localizable", "about.cells.version.caption") } - internal enum Website { /// Visit website internal static let caption = L10n.tr("Localizable", "about.cells.website.caption") } - internal enum WriteReview { /// Write a review internal static let caption = L10n.tr("Localizable", "about.cells.write_review.caption") } } - internal enum Sections { - internal enum Feedback { /// Feedback internal static let header = L10n.tr("Localizable", "about.sections.feedback.header") } - internal enum Info { /// General internal static let header = L10n.tr("Localizable", "about.sections.info.header") } - internal enum Share { /// Share internal static let header = L10n.tr("Localizable", "about.sections.share.header") } - internal enum Source { /// Source code internal static let header = L10n.tr("Localizable", "about.sections.source.header") @@ -70,16 +62,13 @@ internal enum L10n { } internal enum Account { - internal enum Cells { - internal enum Password { /// Password internal static let caption = L10n.tr("Localizable", "account.cells.password.caption") /// secret internal static let placeholder = L10n.tr("Localizable", "account.cells.password.placeholder") } - internal enum Username { /// Username internal static let caption = L10n.tr("Localizable", "account.cells.username.caption") @@ -87,9 +76,7 @@ internal enum L10n { internal static let placeholder = L10n.tr("Localizable", "account.cells.username.placeholder") } } - internal enum SuggestionFooter { - internal enum Infrastructure { /// Use your website credentials. Your username is usually numeric with a "p" prefix. internal static let pia = L10n.tr("Localizable", "account.suggestion_footer.infrastructure.pia") @@ -98,18 +85,14 @@ internal enum L10n { } internal enum Configuration { - internal enum Cells { - internal enum Cipher { /// Cipher internal static let caption = L10n.tr("Localizable", "configuration.cells.cipher.caption") } - internal enum Client { /// Client certificate internal static let caption = L10n.tr("Localizable", "configuration.cells.client.caption") - internal enum Value { /// Not verified internal static let disabled = L10n.tr("Localizable", "configuration.cells.client.value.disabled") @@ -117,21 +100,17 @@ internal enum L10n { internal static let enabled = L10n.tr("Localizable", "configuration.cells.client.value.enabled") } } - internal enum CompressionAlgorithm { /// Compression internal static let caption = L10n.tr("Localizable", "configuration.cells.compression_algorithm.caption") - internal enum Value { /// Disabled internal static let disabled = L10n.tr("Localizable", "configuration.cells.compression_algorithm.value.disabled") } } - internal enum CompressionFrame { /// Framing internal static let caption = L10n.tr("Localizable", "configuration.cells.compression_frame.caption") - internal enum Value { /// Compress internal static let compress = L10n.tr("Localizable", "configuration.cells.compression_frame.value.compress") @@ -141,21 +120,17 @@ internal enum L10n { internal static let lzo = L10n.tr("Localizable", "configuration.cells.compression_frame.value.lzo") } } - internal enum Digest { /// Authentication internal static let caption = L10n.tr("Localizable", "configuration.cells.digest.caption") - internal enum Value { /// Embedded internal static let embedded = L10n.tr("Localizable", "configuration.cells.digest.value.embedded") } } - internal enum KeepAlive { /// Keep-alive internal static let caption = L10n.tr("Localizable", "configuration.cells.keep_alive.caption") - internal enum Value { /// Disabled internal static let never = L10n.tr("Localizable", "configuration.cells.keep_alive.value.never") @@ -165,11 +140,9 @@ internal enum L10n { } } } - internal enum RenegotiationSeconds { /// Renegotiation internal static let caption = L10n.tr("Localizable", "configuration.cells.renegotiation_seconds.caption") - internal enum Value { /// after %@ internal static func after(_ p1: String) -> String { @@ -179,16 +152,13 @@ internal enum L10n { internal static let never = L10n.tr("Localizable", "configuration.cells.renegotiation_seconds.value.never") } } - internal enum ResetOriginal { /// Reset configuration internal static let caption = L10n.tr("Localizable", "configuration.cells.reset_original.caption") } - internal enum TlsWrapping { /// Wrapping internal static let caption = L10n.tr("Localizable", "configuration.cells.tls_wrapping.caption") - internal enum Value { /// Authentication internal static let auth = L10n.tr("Localizable", "configuration.cells.tls_wrapping.value.auth") @@ -199,24 +169,19 @@ internal enum L10n { } } } - internal enum Sections { - internal enum Communication { /// Communication internal static let header = L10n.tr("Localizable", "configuration.sections.communication.header") } - internal enum Other { /// Other internal static let header = L10n.tr("Localizable", "configuration.sections.other.header") } - internal enum Reset { /// If you ended up with broken connectivity after changing the communication parameters, tap to revert to the original configuration. internal static let footer = L10n.tr("Localizable", "configuration.sections.reset.footer") } - internal enum Tls { /// TLS internal static let header = L10n.tr("Localizable", "configuration.sections.tls.header") @@ -227,7 +192,6 @@ internal enum L10n { internal enum Credits { /// Credits internal static let title = L10n.tr("Localizable", "credits.title") - internal enum Labels { /// Passepartout is a non-official client and is in no way affiliated with OpenVPN Inc.\n\nThe logo is taken from the awesome Circle Icons set by Nick Roach. internal static let thirdParties = L10n.tr("Localizable", "credits.labels.third_parties") @@ -235,15 +199,12 @@ internal enum L10n { } internal enum DebugLog { - internal enum Alerts { - internal enum EmptyLog { /// The debug log is empty. internal static let message = L10n.tr("Localizable", "debug_log.alerts.empty_log.message") } } - internal enum Buttons { /// Next internal static let next = L10n.tr("Localizable", "debug_log.buttons.next") @@ -255,7 +216,6 @@ internal enum L10n { internal enum Disclaimer { /// Disclaimer internal static let title = L10n.tr("Localizable", "disclaimer.title") - internal enum Labels { /// Passepartout is a VPN client based on independent work. As such, the developer -while making his best efforts to avoid it- takes no responsibility about any damage caused by the use of this software.\n\nAdditionally, the developer takes no responsibility about data usage, monitoring, logging etc. by the servers you connect to. Passepartout is not even involved in the above choices, as they're part of server-side policies.\n\nFor more information about data usage by third parties, please review the privacy policy of your VPN provider. internal static let text = L10n.tr("Localizable", "disclaimer.labels.text") @@ -263,27 +223,21 @@ internal enum L10n { } internal enum Endpoint { - internal enum Cells { - internal enum AnyAddress { /// Any internal static let caption = L10n.tr("Localizable", "endpoint.cells.any_address.caption") } - internal enum AnyProtocol { /// Any internal static let caption = L10n.tr("Localizable", "endpoint.cells.any_protocol.caption") } } - internal enum Sections { - internal enum LocationAddresses { /// Addresses internal static let header = L10n.tr("Localizable", "endpoint.sections.location_addresses.header") } - internal enum LocationProtocols { /// Protocols internal static let header = L10n.tr("Localizable", "endpoint.sections.location_protocols.header") @@ -310,20 +264,16 @@ internal enum L10n { internal static let message = L10n.tr("Localizable", "issue_reporter.message") /// Report issue internal static let title = L10n.tr("Localizable", "issue_reporter.title") - internal enum Alerts { - internal enum EmailNotConfigured { /// No e-mail account is configured. internal static let message = L10n.tr("Localizable", "issue_reporter.alerts.email_not_configured.message") } } - internal enum Buttons { /// I understand internal static let accept = L10n.tr("Localizable", "issue_reporter.buttons.accept") } - internal enum Email { /// Hi,\n\n%@\n\n%@\n\nRegards internal static func body(_ p1: String, _ p2: String) -> String { @@ -339,67 +289,53 @@ internal enum L10n { } internal enum Organizer { - internal enum Alerts { - internal enum AddHost { /// Open an URL to an .ovpn configuration file from Safari, Mail or another app to set up a host profile.\n\nYou can also import an .ovpn with iTunes File Sharing. internal static let message = L10n.tr("Localizable", "organizer.alerts.add_host.message") } - internal enum DeleteVpnProfile { /// Do you really want to delete the VPN profile from the device? internal static let message = L10n.tr("Localizable", "organizer.alerts.delete_vpn_profile.message") } - internal enum ExhaustedProviders { /// You have created profiles for any available network. internal static let message = L10n.tr("Localizable", "organizer.alerts.exhausted_providers.message") } } - internal enum Cells { - internal enum About { /// About %@ internal static func caption(_ p1: String) -> String { return L10n.tr("Localizable", "organizer.cells.about.caption", p1) } } - internal enum AddHost { /// Add new host internal static let caption = L10n.tr("Localizable", "organizer.cells.add_host.caption") } - internal enum AddProvider { /// Add new network internal static let caption = L10n.tr("Localizable", "organizer.cells.add_provider.caption") } - internal enum Profile { - internal enum Value { /// In use internal static let current = L10n.tr("Localizable", "organizer.cells.profile.value.current") } } - internal enum Uninstall { /// Delete VPN profile internal static let caption = L10n.tr("Localizable", "organizer.cells.uninstall.caption") } } - internal enum Sections { - internal enum Hosts { /// Import hosts from raw .ovpn configuration files. internal static let footer = L10n.tr("Localizable", "organizer.sections.hosts.footer") /// Hosts internal static let header = L10n.tr("Localizable", "organizer.sections.hosts.header") } - internal enum Providers { /// Here you find a few public infrastructures offering preset configuration profiles. internal static let footer = L10n.tr("Localizable", "organizer.sections.providers.footer") @@ -410,35 +346,29 @@ internal enum L10n { } internal enum ParsedFile { - internal enum Alerts { - internal enum Buttons { /// Report an issue internal static let report = L10n.tr("Localizable", "parsed_file.alerts.buttons.report") } - internal enum Missing { /// The configuration file lacks a required option (%@). internal static func message(_ p1: String) -> String { return L10n.tr("Localizable", "parsed_file.alerts.missing.message", p1) } } - internal enum Parsing { /// Unable to parse the provided configuration file (%@). internal static func message(_ p1: String) -> String { return L10n.tr("Localizable", "parsed_file.alerts.parsing.message", p1) } } - internal enum PotentiallyUnsupported { /// The configuration file is correct but contains a potentially unsupported option (%@).\n\nConnectivity may break depending on server settings. internal static func message(_ p1: String) -> String { return L10n.tr("Localizable", "parsed_file.alerts.potentially_unsupported.message", p1) } } - internal enum Unsupported { /// The configuration file contains an unsupported option (%@). internal static func message(_ p1: String) -> String { @@ -449,11 +379,8 @@ internal enum L10n { } internal enum Provider { - internal enum Preset { - internal enum Cells { - internal enum TechDetails { /// Technical details internal static let caption = L10n.tr("Localizable", "provider.preset.cells.tech_details.caption") @@ -467,7 +394,6 @@ internal enum L10n { internal static let message = L10n.tr("Localizable", "reddit.message") /// Reddit internal static let title = L10n.tr("Localizable", "reddit.title") - internal enum Buttons { /// Don't ask again internal static let never = L10n.tr("Localizable", "reddit.buttons.never") @@ -479,16 +405,12 @@ internal enum L10n { } internal enum Service { - internal enum Alerts { - internal enum CredentialsNeeded { /// You need to enter account credentials first. internal static let message = L10n.tr("Localizable", "service.alerts.credentials_needed.message") } - internal enum DataCount { - internal enum Messages { /// Received: %llu\nSent: %llu internal static func current(_ p1: Int, _ p2: Int) -> String { @@ -498,16 +420,13 @@ internal enum L10n { internal static let notAvailable = L10n.tr("Localizable", "service.alerts.data_count.messages.not_available") } } - internal enum ReconnectVpn { /// Do you want to reconnect to the VPN? internal static let message = L10n.tr("Localizable", "service.alerts.reconnect_vpn.message") } - internal enum TestConnectivity { /// Connectivity internal static let title = L10n.tr("Localizable", "service.alerts.test_connectivity.title") - internal enum Messages { /// Your device has no Internet connectivity, please review your profile parameters. internal static let failure = L10n.tr("Localizable", "service.alerts.test_connectivity.messages.failure") @@ -515,54 +434,43 @@ internal enum L10n { internal static let success = L10n.tr("Localizable", "service.alerts.test_connectivity.messages.success") } } - internal enum Trusted { - internal enum NoNetwork { /// You are not connected to any Wi-Fi network. internal static let message = L10n.tr("Localizable", "service.alerts.trusted.no_network.message") } - internal enum WillDisconnectPolicy { /// By changing the trust policy, the VPN may be disconnected. Continue? internal static let message = L10n.tr("Localizable", "service.alerts.trusted.will_disconnect_policy.message") } - internal enum WillDisconnectTrusted { /// By trusting this network, the VPN may be disconnected. Continue? internal static let message = L10n.tr("Localizable", "service.alerts.trusted.will_disconnect_trusted.message") } } } - internal enum Cells { - internal enum Account { /// Account internal static let caption = L10n.tr("Localizable", "service.cells.account.caption") /// None configured internal static let `none` = L10n.tr("Localizable", "service.cells.account.none") } - internal enum ConnectionStatus { /// Status internal static let caption = L10n.tr("Localizable", "service.cells.connection_status.caption") } - internal enum DataCount { /// Exchanged bytes count internal static let caption = L10n.tr("Localizable", "service.cells.data_count.caption") } - internal enum DebugLog { /// Debug log internal static let caption = L10n.tr("Localizable", "service.cells.debug_log.caption") } - internal enum Endpoint { /// Endpoint internal static let caption = L10n.tr("Localizable", "service.cells.endpoint.caption") - internal enum Value { /// Automatic internal static let automatic = L10n.tr("Localizable", "service.cells.endpoint.value.automatic") @@ -570,13 +478,10 @@ internal enum L10n { internal static let manual = L10n.tr("Localizable", "service.cells.endpoint.value.manual") } } - internal enum Host { - internal enum Parameters { /// Parameters internal static let caption = L10n.tr("Localizable", "service.cells.host.parameters.caption") - internal enum Value { /// %@ internal static func cipher(_ p1: String) -> String { @@ -589,137 +494,111 @@ internal enum L10n { } } } - internal enum Provider { - internal enum Pool { /// Location internal static let caption = L10n.tr("Localizable", "service.cells.provider.pool.caption") } - internal enum Preset { /// Preset internal static let caption = L10n.tr("Localizable", "service.cells.provider.preset.caption") } - internal enum Refresh { /// Refresh infrastructure internal static let caption = L10n.tr("Localizable", "service.cells.provider.refresh.caption") } } - internal enum Reconnect { /// Reconnect internal static let caption = L10n.tr("Localizable", "service.cells.reconnect.caption") } - internal enum ReportIssue { /// Report connectivity issue internal static let caption = L10n.tr("Localizable", "service.cells.report_issue.caption") } - internal enum TestConnectivity { /// Test connectivity internal static let caption = L10n.tr("Localizable", "service.cells.test_connectivity.caption") } - internal enum TrustedAddWifi { /// Add current Wi-Fi internal static let caption = L10n.tr("Localizable", "service.cells.trusted_add_wifi.caption") } - internal enum TrustedMobile { /// Cellular network internal static let caption = L10n.tr("Localizable", "service.cells.trusted_mobile.caption") } - internal enum TrustedPolicy { /// Retain existing connection internal static let caption = L10n.tr("Localizable", "service.cells.trusted_policy.caption") } - internal enum TrustedWifi { /// %@ internal static func caption(_ p1: String) -> String { return L10n.tr("Localizable", "service.cells.trusted_wifi.caption", p1) } } - internal enum UseProfile { /// Use this profile internal static let caption = L10n.tr("Localizable", "service.cells.use_profile.caption") } - internal enum VpnResolvesHostname { /// Resolve server hostname internal static let caption = L10n.tr("Localizable", "service.cells.vpn_resolves_hostname.caption") } - internal enum VpnService { /// Enabled internal static let caption = L10n.tr("Localizable", "service.cells.vpn_service.caption") } - internal enum VpnSurvivesSleep { /// Keep alive on sleep internal static let caption = L10n.tr("Localizable", "service.cells.vpn_survives_sleep.caption") } } - internal enum Sections { - internal enum Configuration { /// Configuration internal static let header = L10n.tr("Localizable", "service.sections.configuration.header") } - internal enum Diagnostics { /// Diagnostics internal static let header = L10n.tr("Localizable", "service.sections.diagnostics.header") } - internal enum General { /// General internal static let header = L10n.tr("Localizable", "service.sections.general.header") } - internal enum ProviderInfrastructure { /// Last updated on %@. internal static func footer(_ p1: String) -> String { return L10n.tr("Localizable", "service.sections.provider_infrastructure.footer", p1) } } - internal enum Status { /// Connection internal static let header = L10n.tr("Localizable", "service.sections.status.header") } - internal enum Trusted { /// When entering a trusted network, an existing VPN connection will not be shut down by default. Disable to always enforce a disconnection. internal static let footer = L10n.tr("Localizable", "service.sections.trusted.footer") /// Trusted networks internal static let header = L10n.tr("Localizable", "service.sections.trusted.header") } - internal enum Vpn { /// The connection will be established whenever necessary. internal static let footer = L10n.tr("Localizable", "service.sections.vpn.footer") /// VPN internal static let header = L10n.tr("Localizable", "service.sections.vpn.header") } - internal enum VpnResolvesHostname { /// Preferred in most networks and required in some IPv6 networks. Disable where DNS is blocked, or to speed up negotiation when DNS is slow to respond. internal static let footer = L10n.tr("Localizable", "service.sections.vpn_resolves_hostname.footer") } - internal enum VpnSurvivesSleep { /// Disable to improve battery usage, at the expense of occasional slowdowns due to wake-up reconnections. internal static let footer = L10n.tr("Localizable", "service.sections.vpn_survives_sleep.footer") } } - internal enum Welcome { /// Welcome to Passepartout!\n\nUse the organizer to add a new profile. internal static let message = L10n.tr("Localizable", "service.welcome.message") @@ -732,12 +611,10 @@ internal enum L10n { } internal enum Version { - internal enum Buttons { /// CHANGELOG internal static let changelog = L10n.tr("Localizable", "version.buttons.changelog") } - internal enum Labels { /// Passepartout and TunnelKit are written and maintained by Davide De Rosa (keeshux).\n\nTunnelKit is a native OpenVPN client originally forked from PIATunnel by Private Internet Access.\n\nSource code for Passepartout and TunnelKit is publicly available on GitHub under the GPLv3. internal static let intro = L10n.tr("Localizable", "version.labels.intro") @@ -755,7 +632,6 @@ internal enum L10n { internal static let disconnecting = L10n.tr("Localizable", "vpn.disconnecting") /// Inactive internal static let inactive = L10n.tr("Localizable", "vpn.inactive") - internal enum Errors { /// Auth failed internal static let auth = L10n.tr("Localizable", "vpn.errors.auth") @@ -773,19 +649,14 @@ internal enum L10n { } internal enum Wizards { - internal enum Host { - internal enum Alerts { - internal enum Existing { /// A host profile with the same title already exists. Replace it? internal static let message = L10n.tr("Localizable", "wizards.host.alerts.existing.message") } } - internal enum Cells { - internal enum TitleInput { /// Title internal static let caption = L10n.tr("Localizable", "wizards.host.cells.title_input.caption") @@ -793,9 +664,7 @@ internal enum L10n { internal static let placeholder = L10n.tr("Localizable", "wizards.host.cells.title_input.placeholder") } } - internal enum Sections { - internal enum Existing { /// Existing profiles internal static let header = L10n.tr("Localizable", "wizards.host.sections.existing.header") @@ -804,7 +673,10 @@ internal enum L10n { } } } -// swiftlint:enable explicit_type_interface identifier_name line_length nesting type_body_length type_name +// swiftlint:enable explicit_type_interface function_parameter_count identifier_name line_length +// swiftlint:enable nesting type_body_length type_name + +// MARK: - Implementation Details extension L10n { private static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String { diff --git a/swiftgen.yml b/swiftgen.yml index 30cc2e28b..85cbcbdae 100644 --- a/swiftgen.yml +++ b/swiftgen.yml @@ -1,14 +1,16 @@ strings: - paths: + inputs: - Passepartout/Resources/en.lproj/Localizable.strings - templateName: structured-swift4 - output: Passepartout/Sources/SwiftGen+Strings.swift + outputs: + - templateName: structured-swift4 + output: Passepartout/Sources/SwiftGen+Strings.swift -storyboards: - paths: +ib: + inputs: - Passepartout-iOS/en.lproj/Main.storyboard - Passepartout-iOS/en.lproj/Organizer.storyboard - templateName: swift4 - output: Passepartout-iOS/Global/SwiftGen+Storyboards.swift - params: - module: Passepartout + outputs: + - templateName: scenes-swift4 + output: Passepartout-iOS/Global/SwiftGen+Scenes.swift + - templateName: segues-swift4 + output: Passepartout-iOS/Global/SwiftGen+Segues.swift