diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2021-07-21 12:15:55 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2021-07-21 12:15:55 +0200 |
| commit | 87bedd4e7ecf37c3048c9fdb1d94b129a99ff680 (patch) | |
| tree | f54381a13097d9aed5d37643abfe59daa5d7f4d2 | |
| parent | e5e1cc386454e75c9c8c145f58f3bde8236d1fa0 (diff) | |
| parent | 3f4c06029971afa46e646e86c5c50a119f800778 (diff) | |
| download | mullvadvpn-87bedd4e7ecf37c3048c9fdb1d94b129a99ff680.tar.xz mullvadvpn-87bedd4e7ecf37c3048c9fdb1d94b129a99ff680.zip | |
Merge branch 'localize-settings'
| -rw-r--r-- | ios/MullvadVPN.xcodeproj/project.pbxproj | 12 | ||||
| -rw-r--r-- | ios/MullvadVPN/SettingsAccountCell.swift | 13 | ||||
| -rw-r--r-- | ios/MullvadVPN/SettingsViewController.swift | 14 | ||||
| -rw-r--r-- | ios/MullvadVPN/en.lproj/Settings.strings | 23 |
4 files changed, 53 insertions, 9 deletions
diff --git a/ios/MullvadVPN.xcodeproj/project.pbxproj b/ios/MullvadVPN.xcodeproj/project.pbxproj index d475d0dc46..189773097a 100644 --- a/ios/MullvadVPN.xcodeproj/project.pbxproj +++ b/ios/MullvadVPN.xcodeproj/project.pbxproj @@ -64,6 +64,7 @@ 582BB1B3229574F40055B6EF /* SettingsAccountCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 582BB1B2229574F40055B6EF /* SettingsAccountCell.swift */; }; 582BB1B52295780F0055B6EF /* AccountExpiry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 582BB1B42295780F0055B6EF /* AccountExpiry.swift */; }; 582CFEE726945FC30072883A /* AppStoreSubscriptions.strings in Resources */ = {isa = PBXBuildFile; fileRef = 582CFEE526945FC30072883A /* AppStoreSubscriptions.strings */; }; + 582CFEEA269463B80072883A /* Settings.strings in Resources */ = {isa = PBXBuildFile; fileRef = 582CFEE8269463B80072883A /* Settings.strings */; }; 5835B7CC233B76CB0096D79F /* TunnelManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5835B7CB233B76CB0096D79F /* TunnelManager.swift */; }; 583BC70724FE4DC500C9DE04 /* Optional+DispatchQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 583BC70624FE4DC400C9DE04 /* Optional+DispatchQueue.swift */; }; 583BC70824FE4DC500C9DE04 /* Optional+DispatchQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 583BC70624FE4DC400C9DE04 /* Optional+DispatchQueue.swift */; }; @@ -331,6 +332,7 @@ 582BB1B2229574F40055B6EF /* SettingsAccountCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsAccountCell.swift; sourceTree = "<group>"; }; 582BB1B42295780F0055B6EF /* AccountExpiry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountExpiry.swift; sourceTree = "<group>"; }; 582CFEE626945FC30072883A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/AppStoreSubscriptions.strings; sourceTree = "<group>"; }; + 582CFEE9269463B80072883A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Settings.strings; sourceTree = "<group>"; }; 5835B7CB233B76CB0096D79F /* TunnelManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TunnelManager.swift; sourceTree = "<group>"; }; 583BC70624FE4DC400C9DE04 /* Optional+DispatchQueue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Optional+DispatchQueue.swift"; sourceTree = "<group>"; }; 583DA21325FA4B5C00318683 /* LocationDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationDataSource.swift; sourceTree = "<group>"; }; @@ -549,6 +551,7 @@ 58F559072697002100F630D0 /* ConnectionPanel.strings */, 587B7543266922BF00DEF7E9 /* Localizable.strings */, 58F559052697002000F630D0 /* Main.strings */, + 582CFEE8269463B80072883A /* Settings.strings */, 58F61F4D2692F21C00DCFC2B /* WireguardKeys.strings */, ); name = Localizations; @@ -966,6 +969,7 @@ 58F61F4F2692F21C00DCFC2B /* WireguardKeys.strings in Resources */, 58F5590E2697002100F630D0 /* Main.strings in Resources */, 581FC4FA2695ACE100AA97BA /* Account.strings in Resources */, + 582CFEEA269463B80072883A /* Settings.strings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1277,6 +1281,14 @@ name = AppStoreSubscriptions.strings; sourceTree = "<group>"; }; + 582CFEE8269463B80072883A /* Settings.strings */ = { + isa = PBXVariantGroup; + children = ( + 582CFEE9269463B80072883A /* en */, + ); + name = Settings.strings; + sourceTree = "<group>"; + }; 587B7543266922BF00DEF7E9 /* Localizable.strings */ = { isa = PBXVariantGroup; children = ( diff --git a/ios/MullvadVPN/SettingsAccountCell.swift b/ios/MullvadVPN/SettingsAccountCell.swift index 1dbbee3198..11794a6088 100644 --- a/ios/MullvadVPN/SettingsAccountCell.swift +++ b/ios/MullvadVPN/SettingsAccountCell.swift @@ -21,11 +21,20 @@ class SettingsAccountCell: SettingsCell { let accountExpiry = AccountExpiry(date: accountExpiryDate) if accountExpiry.isExpired { - detailTitleLabel.text = NSLocalizedString("OUT OF TIME", comment: "") + detailTitleLabel.text = NSLocalizedString( + "ACCOUNT_CELL_OUT_OF_TIME_LABEL", + tableName: "Settings", + comment: "Label displayed when user account ran out of time." + ) detailTitleLabel.textColor = .dangerColor } else { if let remainingTime = accountExpiry.formattedRemainingTime { - let localizedString = NSLocalizedString("%@ left", comment: "") + let localizedString = NSLocalizedString( + "ACCOUNT_CELL_TIME_LEFT_LABEL_FORMAT", + tableName: "Settings", + value: "%@ left", + comment: "The amount of time left on user account. Use %@ placeholder to position the localized text with the time duration left (i.e 10 days)." + ) let formattedString = String(format: localizedString, remainingTime) detailTitleLabel.text = formattedString.uppercased() diff --git a/ios/MullvadVPN/SettingsViewController.swift b/ios/MullvadVPN/SettingsViewController.swift index a1a32f842f..769181dfc8 100644 --- a/ios/MullvadVPN/SettingsViewController.swift +++ b/ios/MullvadVPN/SettingsViewController.swift @@ -56,7 +56,7 @@ class SettingsViewController: UITableViewController, AccountObserver { tableView.register(SettingsCell.self, forCellReuseIdentifier: CellIdentifier.basicCell.rawValue) tableView.register(EmptyTableViewHeaderFooterView.self, forHeaderFooterViewReuseIdentifier: EmptyTableViewHeaderFooterView.reuseIdentifier) - navigationItem.title = NSLocalizedString("Settings", comment: "Navigation title") + navigationItem.title = NSLocalizedString("NAVIGATION_TITLE", tableName: "Settings", comment: "Navigation title") navigationItem.largeTitleDisplayMode = .always navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(handleDismiss)) @@ -94,7 +94,7 @@ class SettingsViewController: UITableViewController, AccountObserver { let accountRow = StaticTableViewRow(reuseIdentifier: CellIdentifier.accountCell.rawValue) { (_, cell) in let cell = cell as! SettingsAccountCell - cell.titleLabel.text = NSLocalizedString("Account", comment: "") + cell.titleLabel.text = NSLocalizedString("ACCOUNT_CELL_LABEL", tableName: "Settings", comment: "") cell.accountExpiryDate = Account.shared.expiry cell.accessibilityIdentifier = "AccountCell" cell.accessoryType = .disclosureIndicator @@ -106,7 +106,7 @@ class SettingsViewController: UITableViewController, AccountObserver { let preferencesRow = StaticTableViewRow(reuseIdentifier: CellIdentifier.basicCell.rawValue) { (_, cell) in let cell = cell as! SettingsCell - cell.titleLabel.text = NSLocalizedString("Preferences", comment: "") + cell.titleLabel.text = NSLocalizedString("PREFERENCES_CELL_LABEL", tableName: "Settings", comment: "") cell.accessoryType = .disclosureIndicator } @@ -117,7 +117,7 @@ class SettingsViewController: UITableViewController, AccountObserver { let wireguardKeyRow = StaticTableViewRow(reuseIdentifier: CellIdentifier.basicCell.rawValue) { (_, cell) in let cell = cell as! SettingsCell - cell.titleLabel.text = NSLocalizedString("WireGuard key", comment: "") + cell.titleLabel.text = NSLocalizedString("WIREGUARD_KEY_CELL_LABEL", tableName: "Settings", comment: "") cell.accessibilityIdentifier = "WireGuardKeyCell" cell.accessoryType = .disclosureIndicator } @@ -135,7 +135,7 @@ class SettingsViewController: UITableViewController, AccountObserver { let middleSection = StaticTableViewSection() let versionRow = StaticTableViewRow(reuseIdentifier: CellIdentifier.basicCell.rawValue) { (_, cell) in let cell = cell as! SettingsCell - cell.titleLabel.text = NSLocalizedString("App version", comment: "") + cell.titleLabel.text = NSLocalizedString("APP_VERSION_CELL_LABEL", tableName: "Settings", comment: "") cell.detailTitleLabel.text = Bundle.main.productVersion } versionRow.isSelectable = false @@ -147,7 +147,7 @@ class SettingsViewController: UITableViewController, AccountObserver { let logStreamerRow = StaticTableViewRow(reuseIdentifier: CellIdentifier.basicCell.rawValue) { (_, cell) in let cell = cell as! SettingsCell - cell.titleLabel.text = NSLocalizedString("App logs", comment: "") + cell.titleLabel.text = "App logs" } logStreamerRow.actionBlock = { [weak self] (indexPath) in let logController = LogStreamerViewController(fileURLs: ApplicationConfiguration.logFileURLs) @@ -165,7 +165,7 @@ class SettingsViewController: UITableViewController, AccountObserver { let problemReportRow = StaticTableViewRow(reuseIdentifier: CellIdentifier.basicCell.rawValue) { (indexPath, cell) in let cell = cell as! SettingsCell - cell.titleLabel.text = NSLocalizedString("Report a problem", comment: "") + cell.titleLabel.text = NSLocalizedString("REPORT_PROBLEM_CELL_LABEL", tableName: "Settings", comment: "") cell.accessoryType = .disclosureIndicator } diff --git a/ios/MullvadVPN/en.lproj/Settings.strings b/ios/MullvadVPN/en.lproj/Settings.strings new file mode 100644 index 0000000000..b221be2c46 --- /dev/null +++ b/ios/MullvadVPN/en.lproj/Settings.strings @@ -0,0 +1,23 @@ +/* No comment provided by engineer. */ +"ACCOUNT_CELL_LABEL" = "Account"; + +/* Label displayed when user account ran out of time. */ +"ACCOUNT_CELL_OUT_OF_TIME_LABEL" = "OUT OF TIME"; + +/* The amount of time left on user account. Use %@ placeholder to position the localized text with the time duration left (i.e 10 days). */ +"ACCOUNT_CELL_TIME_LEFT_LABEL_FORMAT" = "%@ left"; + +/* No comment provided by engineer. */ +"APP_VERSION_CELL_LABEL" = "App version"; + +/* Navigation title */ +"NAVIGATION_TITLE" = "Settings"; + +/* No comment provided by engineer. */ +"PREFERENCES_CELL_LABEL" = "Preferences"; + +/* No comment provided by engineer. */ +"REPORT_PROBLEM_CELL_LABEL" = "Report a problem"; + +/* No comment provided by engineer. */ +"WIREGUARD_KEY_CELL_LABEL" = "WireGuard key"; |
