diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2021-07-08 11:51:16 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2021-07-19 11:14:11 +0200 |
| commit | be224cabbd02e8b88913ac7fde973a2da8252c3d (patch) | |
| tree | 00ae2b5436aac5cd751cb8663ad38339d85ea58d | |
| parent | 6dea229009c1059d2e94af07c0c2389931681d55 (diff) | |
| download | mullvadvpn-be224cabbd02e8b88913ac7fde973a2da8252c3d.tar.xz mullvadvpn-be224cabbd02e8b88913ac7fde973a2da8252c3d.zip | |
Localize Main
| -rw-r--r-- | ios/MullvadVPN.xcodeproj/project.pbxproj | 12 | ||||
| -rw-r--r-- | ios/MullvadVPN/ConnectViewController.swift | 110 | ||||
| -rw-r--r-- | ios/MullvadVPN/en.lproj/Main.strings | 41 |
3 files changed, 145 insertions, 18 deletions
diff --git a/ios/MullvadVPN.xcodeproj/project.pbxproj b/ios/MullvadVPN.xcodeproj/project.pbxproj index 107af7f8fe..8ff8894616 100644 --- a/ios/MullvadVPN.xcodeproj/project.pbxproj +++ b/ios/MullvadVPN.xcodeproj/project.pbxproj @@ -220,6 +220,7 @@ 58F3C0A4249CB069003E76BE /* HeaderBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58F3C0A3249CB069003E76BE /* HeaderBarView.swift */; }; 58F3C0A624A50157003E76BE /* relays.json in Resources */ = {isa = PBXBuildFile; fileRef = 58F3C0A524A50155003E76BE /* relays.json */; }; 58F3C0A724A50C02003E76BE /* relays.json in Resources */ = {isa = PBXBuildFile; fileRef = 58F3C0A524A50155003E76BE /* relays.json */; }; + 58F5590E2697002100F630D0 /* Main.strings in Resources */ = {isa = PBXBuildFile; fileRef = 58F559052697002000F630D0 /* Main.strings */; }; 58F5590F2697002100F630D0 /* ConnectionPanel.strings in Resources */ = {isa = PBXBuildFile; fileRef = 58F559072697002100F630D0 /* ConnectionPanel.strings */; }; 58F61F4F2692F21C00DCFC2B /* WireguardKeys.strings in Resources */ = {isa = PBXBuildFile; fileRef = 58F61F4D2692F21C00DCFC2B /* WireguardKeys.strings */; }; 58F7CA882692E34000FC59FD /* WireguardKeysContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58F7CA872692E34000FC59FD /* WireguardKeysContentView.swift */; }; @@ -435,6 +436,7 @@ 58F19E34228C15BA00C7710B /* SpinnerActivityIndicatorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpinnerActivityIndicatorView.swift; sourceTree = "<group>"; }; 58F3C0A3249CB069003E76BE /* HeaderBarView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderBarView.swift; sourceTree = "<group>"; }; 58F3C0A524A50155003E76BE /* relays.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = relays.json; sourceTree = "<group>"; }; + 58F559062697002000F630D0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Main.strings; sourceTree = "<group>"; }; 58F559082697002100F630D0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/ConnectionPanel.strings; sourceTree = "<group>"; }; 58F61F4E2692F21C00DCFC2B /* en */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/WireguardKeys.strings; sourceTree = "<group>"; }; 58F7CA872692E34000FC59FD /* WireguardKeysContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WireguardKeysContentView.swift; sourceTree = "<group>"; }; @@ -543,6 +545,7 @@ 582CFEE526945FC30072883A /* AppStoreSubscriptions.strings */, 58F559072697002100F630D0 /* ConnectionPanel.strings */, 587B7543266922BF00DEF7E9 /* Localizable.strings */, + 58F559052697002000F630D0 /* Main.strings */, 58F61F4D2692F21C00DCFC2B /* WireguardKeys.strings */, ); name = Localizations; @@ -958,6 +961,7 @@ 584789BE264D4A2A000E45FB /* new_le_root_cert.cer in Resources */, 58F61F4F2692F21C00DCFC2B /* WireguardKeys.strings in Resources */, 58E5BC2624FEB6DB00A53A76 /* AccountViewController.xib in Resources */, + 58F5590E2697002100F630D0 /* Main.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1268,6 +1272,14 @@ name = Localizable.strings; sourceTree = "<group>"; }; + 58F559052697002000F630D0 /* Main.strings */ = { + isa = PBXVariantGroup; + children = ( + 58F559062697002000F630D0 /* en */, + ); + name = Main.strings; + sourceTree = "<group>"; + }; 58F559072697002100F630D0 /* ConnectionPanel.strings */ = { isa = PBXVariantGroup; children = ( diff --git a/ios/MullvadVPN/ConnectViewController.swift b/ios/MullvadVPN/ConnectViewController.swift index 820b591855..f010eec162 100644 --- a/ios/MullvadVPN/ConnectViewController.swift +++ b/ios/MullvadVPN/ConnectViewController.swift @@ -163,7 +163,12 @@ class ConnectViewController: UIViewController, MKMapViewDelegate, RootContainmen mainContentView.connectButton.setTitle(tunnelState.localizedTitleForConnectButton, for: .normal) mainContentView.selectLocationButton.setTitle(tunnelState.localizedTitleForSelectLocationButton, for: .normal) mainContentView.splitDisconnectButton.primaryButton.setTitle(tunnelState.localizedTitleForDisconnectButton, for: .normal) - mainContentView.splitDisconnectButton.secondaryButton.accessibilityLabel = NSLocalizedString("RECONNECT_BUTTON_ACCESSIBILITY_LABEL", comment: "") + mainContentView.splitDisconnectButton.secondaryButton.accessibilityLabel = NSLocalizedString( + "RECONNECT_BUTTON_ACCESSIBILITY_LABEL", + tableName: "Main", + value: "Reconnect", + comment: "" + ) updateTraitDependentViews() } @@ -408,58 +413,127 @@ private extension TunnelState { var localizedTitleForSecureLabel: String { switch self { case .connecting, .reconnecting: - return NSLocalizedString("Creating secure connection", comment: "") + return NSLocalizedString( + "TUNNEL_STATE_CONNECTING", + tableName: "Main", + value: "Creating secure connection", + comment: "" + ) case .connected: - return NSLocalizedString("Secure connection", comment: "") + return NSLocalizedString( + "TUNNEL_STATE_CONNECTED", + tableName: "Main", + value: "Secure connection", + comment: "" + ) case .disconnecting, .disconnected: - return NSLocalizedString("Unsecure connection", comment: "") + return NSLocalizedString( + "TUNNEL_STATE_DISCONNECTED", + tableName: "Main", + value: "Unsecure connection", + comment: "" + ) } } var localizedTitleForSelectLocationButton: String? { switch self { case .disconnected, .disconnecting: - return NSLocalizedString("Select location", comment: "") + return NSLocalizedString( + "SELECT_LOCATION_BUTTON_TITLE", + tableName: "Main", + value: "Select location", + comment: "" + ) case .connecting, .connected, .reconnecting: - return NSLocalizedString("Switch location", comment: "") + return NSLocalizedString( + "SWITCH_LOCATION_BUTTON_TITLE", + tableName: "Main", + value: "Switch location", + comment: "" + ) } } var localizedTitleForConnectButton: String { - return NSLocalizedString("Secure connection", comment: "") + return NSLocalizedString( + "CONNECT_BUTTON_TITLE", + tableName: "Main", + value: "Secure connection", + comment: "" + ) } var localizedTitleForDisconnectButton: String { switch self { case .connecting: - return NSLocalizedString("Cancel", comment: "") + return NSLocalizedString( + "CANCEL_BUTTON_TITLE", + tableName: "Main", + value: "Cancel", + comment: "" + ) case .connected, .reconnecting, .disconnecting, .disconnected: - return NSLocalizedString("Disconnect", comment: "") + return NSLocalizedString( + "DISCONNECT_BUTTON_TITLE", + tableName: "Main", + value: "Disconnect", + comment: "" + ) } } var localizedAccessibilityLabel: String { switch self { case .connecting: - return NSLocalizedString("Creating secure connection", comment: "") + return NSLocalizedString( + "TUNNEL_STATE_CONNECTING_ACCESSIBILITY_LABEL", + tableName: "Main", + value: "Creating secure connection", + comment: "" + ) case .connected(let tunnelInfo): - return String(format: NSLocalizedString("Secure connection. Connected to %@, %@", comment: ""), - tunnelInfo.location.city, - tunnelInfo.location.country) + return String( + format: NSLocalizedString( + "TUNNEL_STATE_CONNECTED_ACCESSIBILITY_LABEL", + tableName: "Main", + value: "Secure connection. Connected to %@, %@", + comment: "" + ), + tunnelInfo.location.city, + tunnelInfo.location.country + ) case .disconnected: - return NSLocalizedString("Unsecured connection", comment: "") + return NSLocalizedString( + "TUNNEL_STATE_DISCONNECTED_ACCESSIBILITY_LABEL", + tableName: "Main", + value: "Unsecured connection", + comment: "" + ) case .reconnecting(let tunnelInfo): - return String(format: NSLocalizedString("Reconnecting to %@, %@", comment: ""), - tunnelInfo.location.city, - tunnelInfo.location.country) + return String( + format: NSLocalizedString( + "TUNNEL_STATE_RECONNECTING_ACCESSIBILITY_LABEL", + tableName: "Main", + value: "Reconnecting to %@, %@", + comment: "" + ), + tunnelInfo.location.city, + tunnelInfo.location.country + ) case .disconnecting: - return NSLocalizedString("Disconnecting", comment: "") + return NSLocalizedString( + "TUNNEL_STATE_DISCONNECTING_ACCESSIBILITY_LABEL", + tableName: "Main", + value: "Disconnecting", + comment: "" + ) } } diff --git a/ios/MullvadVPN/en.lproj/Main.strings b/ios/MullvadVPN/en.lproj/Main.strings new file mode 100644 index 0000000000..8e5b567739 --- /dev/null +++ b/ios/MullvadVPN/en.lproj/Main.strings @@ -0,0 +1,41 @@ +/* No comment provided by engineer. */ +"CANCEL_BUTTON_TITLE" = "Cancel"; + +/* No comment provided by engineer. */ +"CONNECT_BUTTON_TITLE" = "Secure connection"; + +/* No comment provided by engineer. */ +"DISCONNECT_BUTTON_TITLE" = "Disconnect"; + +/* No comment provided by engineer. */ +"RECONNECT_BUTTON_ACCESSIBILITY_LABEL" = "Reconnect"; + +/* No comment provided by engineer. */ +"SELECT_LOCATION_BUTTON_TITLE" = "Select location"; + +/* No comment provided by engineer. */ +"SWITCH_LOCATION_BUTTON_TITLE" = "Switch location"; + +/* No comment provided by engineer. */ +"TUNNEL_STATE_CONNECTED" = "Secure connection"; + +/* No comment provided by engineer. */ +"TUNNEL_STATE_CONNECTED_ACCESSIBILITY_LABEL" = "Secure connection. Connected to %1$@, %2$@"; + +/* No comment provided by engineer. */ +"TUNNEL_STATE_CONNECTING" = "Creating secure connection"; + +/* No comment provided by engineer. */ +"TUNNEL_STATE_CONNECTING_ACCESSIBILITY_LABEL" = "Creating secure connection"; + +/* No comment provided by engineer. */ +"TUNNEL_STATE_DISCONNECTED" = "Unsecure connection"; + +/* No comment provided by engineer. */ +"TUNNEL_STATE_DISCONNECTED_ACCESSIBILITY_LABEL" = "Unsecured connection"; + +/* No comment provided by engineer. */ +"TUNNEL_STATE_DISCONNECTING_ACCESSIBILITY_LABEL" = "Disconnecting"; + +/* No comment provided by engineer. */ +"TUNNEL_STATE_RECONNECTING_ACCESSIBILITY_LABEL" = "Reconnecting to %1$@, %2$@"; |
