summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2021-07-07 13:43:25 +0200
committerAndrej Mihajlov <and@mullvad.net>2021-07-21 12:25:33 +0200
commit0c040e1da577c60c6ded27f334502747dec355ed (patch)
tree5ab07ed5dc94db61cf83de29988f7b87507a31e4
parent6ca71f1581347d89138722e8b02624731cdab42b (diff)
downloadmullvadvpn-0c040e1da577c60c6ded27f334502747dec355ed.tar.xz
mullvadvpn-0c040e1da577c60c6ded27f334502747dec355ed.zip
Localize ProblemReport
-rw-r--r--ios/MullvadVPN.xcodeproj/project.pbxproj12
-rw-r--r--ios/MullvadVPN/ProblemReportSubmissionOverlayView.swift64
-rw-r--r--ios/MullvadVPN/ProblemReportViewController.swift51
-rw-r--r--ios/MullvadVPN/en.lproj/ProblemReport.strings50
4 files changed, 159 insertions, 18 deletions
diff --git a/ios/MullvadVPN.xcodeproj/project.pbxproj b/ios/MullvadVPN.xcodeproj/project.pbxproj
index c6e0abe0bf..878b7e56f0 100644
--- a/ios/MullvadVPN.xcodeproj/project.pbxproj
+++ b/ios/MullvadVPN.xcodeproj/project.pbxproj
@@ -225,6 +225,7 @@
58F558DD2695B85E00F630D0 /* Consent.strings in Resources */ = {isa = PBXBuildFile; fileRef = 58F558DB2695B85E00F630D0 /* Consent.strings */; };
58F558E02695BD3E00F630D0 /* Login.strings in Resources */ = {isa = PBXBuildFile; fileRef = 58F558DE2695BD3E00F630D0 /* Login.strings */; };
58F558E32695D1D800F630D0 /* Preferences.strings in Resources */ = {isa = PBXBuildFile; fileRef = 58F558E12695D1D800F630D0 /* Preferences.strings */; };
+ 58F558E62695D1F200F630D0 /* ProblemReport.strings in Resources */ = {isa = PBXBuildFile; fileRef = 58F558E42695D1F200F630D0 /* ProblemReport.strings */; };
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 */; };
@@ -446,6 +447,7 @@
58F558DC2695B85E00F630D0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Consent.strings; sourceTree = "<group>"; };
58F558DF2695BD3E00F630D0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Login.strings; sourceTree = "<group>"; };
58F558E22695D1D800F630D0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Preferences.strings; sourceTree = "<group>"; };
+ 58F558E52695D1F200F630D0 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/ProblemReport.strings; 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>"; };
@@ -560,6 +562,7 @@
58F558DE2695BD3E00F630D0 /* Login.strings */,
58F559052697002000F630D0 /* Main.strings */,
58F558E12695D1D800F630D0 /* Preferences.strings */,
+ 58F558E42695D1F200F630D0 /* ProblemReport.strings */,
582CFEE8269463B80072883A /* Settings.strings */,
58F61F4D2692F21C00DCFC2B /* WireguardKeys.strings */,
);
@@ -977,6 +980,7 @@
58F558E32695D1D800F630D0 /* Preferences.strings in Resources */,
582CFEE726945FC30072883A /* AppStoreSubscriptions.strings in Resources */,
584789B8264D4A2A000E45FB /* old_le_root_cert.cer in Resources */,
+ 58F558E62695D1F200F630D0 /* ProblemReport.strings in Resources */,
584789BE264D4A2A000E45FB /* new_le_root_cert.cer in Resources */,
58F61F4F2692F21C00DCFC2B /* WireguardKeys.strings in Resources */,
58F5590E2697002100F630D0 /* Main.strings in Resources */,
@@ -1333,6 +1337,14 @@
name = Preferences.strings;
sourceTree = "<group>";
};
+ 58F558E42695D1F200F630D0 /* ProblemReport.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 58F558E52695D1F200F630D0 /* en */,
+ );
+ name = ProblemReport.strings;
+ sourceTree = "<group>";
+ };
58F559052697002000F630D0 /* Main.strings */ = {
isa = PBXVariantGroup;
children = (
diff --git a/ios/MullvadVPN/ProblemReportSubmissionOverlayView.swift b/ios/MullvadVPN/ProblemReportSubmissionOverlayView.swift
index 5bbd9a5077..be658c3ef6 100644
--- a/ios/MullvadVPN/ProblemReportSubmissionOverlayView.swift
+++ b/ios/MullvadVPN/ProblemReportSubmissionOverlayView.swift
@@ -22,11 +22,26 @@ class ProblemReportSubmissionOverlayView: UIView {
var title: String? {
switch self {
case .sending:
- return NSLocalizedString("Sending...", comment: "")
+ return NSLocalizedString(
+ "SUBMISSION_STATUS_SENDING",
+ tableName: "ProblemReport",
+ value: "Sending...",
+ comment: ""
+ )
case .sent:
- return NSLocalizedString("Sent", comment: "")
+ return NSLocalizedString(
+ "SUBMISSION_STATUS_SENT",
+ tableName: "ProblemReport",
+ value: "Sent",
+ comment: ""
+ )
case .failure:
- return NSLocalizedString("Failed to send", comment: "")
+ return NSLocalizedString(
+ "SUBMISSION_STATUS_FAILURE",
+ tableName: "ProblemReport",
+ value: "Failed to send",
+ comment: ""
+ )
}
}
@@ -35,13 +50,36 @@ class ProblemReportSubmissionOverlayView: UIView {
case .sending:
return nil
case .sent(let email):
- let combinedAttributedString = NSMutableAttributedString(string: NSLocalizedString("Thanks!", comment: ""), attributes: [.foregroundColor: UIColor.successColor])
+ let combinedAttributedString = NSMutableAttributedString(
+ string: NSLocalizedString(
+ "THANKS_MESSAGE",
+ tableName: "ProblemReport",
+ value: "Thanks!",
+ comment: ""
+ ),
+ attributes: [.foregroundColor: UIColor.successColor]
+ )
if email.isEmpty {
combinedAttributedString.append(NSAttributedString(string: " "))
- combinedAttributedString.append(NSAttributedString(string: NSLocalizedString("We will look into this.", comment: "")))
+ combinedAttributedString.append(
+ NSAttributedString(
+ string: NSLocalizedString(
+ "WE_WILL_LOOK_INTO_THIS_MESSAGE",
+ tableName: "ProblemReport",
+ value: "We will look into this.",
+ comment: ""
+ )
+ )
+ )
} else {
- let emailText = String(format: NSLocalizedString("If needed we will contact you on %@", comment: ""), email)
+ let emailText = String(
+ format: NSLocalizedString(
+ "CONTACT_BACK_EMAIL_MESSAGE_FORMAT",
+ tableName: "ProblemReport",
+ value: "If needed we will contact you on %@",
+ comment: ""
+ ), email)
let emailAttributedString = NSMutableAttributedString(string: emailText)
if let emailRange = emailText.range(of: email) {
let font = UIFont.systemFont(ofSize: 17, weight: .bold)
@@ -104,7 +142,12 @@ class ProblemReportSubmissionOverlayView: UIView {
private lazy var editMessageButton: AppButton = {
let button = AppButton(style: .default)
button.translatesAutoresizingMaskIntoConstraints = false
- button.setTitle(NSLocalizedString("Edit message", comment: ""), for: .normal)
+ button.setTitle(NSLocalizedString(
+ "EDIT_MESSAGE_BUTTON",
+ tableName: "ProblemReport",
+ value: "Edit message",
+ comment: ""
+ ), for: .normal)
button.addTarget(self, action: #selector(handleEditButton), for: .touchUpInside)
return button
}()
@@ -112,7 +155,12 @@ class ProblemReportSubmissionOverlayView: UIView {
private lazy var tryAgainButton: AppButton = {
let button = AppButton(style: .success)
button.translatesAutoresizingMaskIntoConstraints = false
- button.setTitle(NSLocalizedString("Try again", comment: ""), for: .normal)
+ button.setTitle(NSLocalizedString(
+ "TRY_AGAIN_BUTTON",
+ tableName: "ProblemReport",
+ value: "Try again",
+ comment: ""
+ ), for: .normal)
button.addTarget(self, action: #selector(handleRetryButton), for: .touchUpInside)
return button
}()
diff --git a/ios/MullvadVPN/ProblemReportViewController.swift b/ios/MullvadVPN/ProblemReportViewController.swift
index c610c03c34..1535d1ec26 100644
--- a/ios/MullvadVPN/ProblemReportViewController.swift
+++ b/ios/MullvadVPN/ProblemReportViewController.swift
@@ -53,8 +53,11 @@ class ProblemReportViewController: UIViewController, UITextFieldDelegate, Condit
textLabel.translatesAutoresizingMaskIntoConstraints = false
textLabel.numberOfLines = 0
textLabel.textColor = .white
- textLabel.text = NSLocalizedString("To help you more effectively, your app's log file will be attached to this message. Your data will remain secure and private, as it is anonymised before being sent over an encrypted channel.", comment: "")
-
+ textLabel.text = NSLocalizedString(
+ "SUBHEAD_LABEL",
+ tableName: "ProblemReport",
+ comment: "Subhead label displayed below navigation title."
+ )
return textLabel
}()
@@ -72,7 +75,11 @@ class ProblemReportViewController: UIViewController, UITextFieldDelegate, Condit
textField.backgroundColor = .white
textField.inputAccessoryView = emailAccessoryToolbar
textField.font = UIFont.systemFont(ofSize: 17)
- textField.placeholder = NSLocalizedString("Your email (optional)", comment: "")
+ textField.placeholder = NSLocalizedString(
+ "EMAIL_TEXTFIELD_PLACEHOLDER",
+ tableName: "ProblemReport",
+ comment: "Placeholder for email text field."
+ )
return textField
}()
@@ -83,7 +90,11 @@ class ProblemReportViewController: UIViewController, UITextFieldDelegate, Condit
textView.backgroundColor = .white
textView.inputAccessoryView = messageAccessoryToolbar
textView.font = UIFont.systemFont(ofSize: 17)
- textView.placeholder = NSLocalizedString("Please describe your problem in English or Swedish", comment: "")
+ textView.placeholder = NSLocalizedString(
+ "DESCRIPTION_TEXTVIEW_PLACEHOLDER",
+ tableName: "ProblemReport",
+ comment: "Placeholder for description text view."
+ )
textView.contentInsetAdjustmentBehavior = .never
return textView
@@ -127,7 +138,11 @@ class ProblemReportViewController: UIViewController, UITextFieldDelegate, Condit
private lazy var viewLogsButton: AppButton = {
let button = AppButton(style: .default)
button.translatesAutoresizingMaskIntoConstraints = false
- button.setTitle(NSLocalizedString("View app logs", comment: ""), for: .normal)
+ button.setTitle(NSLocalizedString(
+ "VIEW_APP_LOGS_BUTTON_TITLE",
+ tableName: "ProblemReport",
+ comment: "Title for button to view application logs"
+ ), for: .normal)
button.addTarget(self, action: #selector(handleViewLogsButtonTap), for: .touchUpInside)
return button
}()
@@ -135,7 +150,11 @@ class ProblemReportViewController: UIViewController, UITextFieldDelegate, Condit
private lazy var sendButton: AppButton = {
let button = AppButton(style: .success)
button.translatesAutoresizingMaskIntoConstraints = false
- button.setTitle(NSLocalizedString("Send", comment: ""), for: .normal)
+ button.setTitle(NSLocalizedString(
+ "SEND_BUTTON_TITLE",
+ tableName: "ProblemReport",
+ comment: "Title for button to send problem report."
+ ), for: .normal)
button.addTarget(self, action: #selector(handleSendButtonTap), for: .touchUpInside)
return button
}()
@@ -175,7 +194,7 @@ class ProblemReportViewController: UIViewController, UITextFieldDelegate, Condit
view.backgroundColor = .secondaryColor
- navigationItem.title = NSLocalizedString("Report a problem", comment: "Navigation title")
+ navigationItem.title = NSLocalizedString("NAVIGATION_TITLE", tableName: "ProblemReport", comment: "Navigation title")
textViewKeyboardResponder = AutomaticKeyboardResponder(targetView: messageTextView)
scrollViewKeyboardResponder = AutomaticKeyboardResponder(targetView: scrollView)
@@ -425,14 +444,26 @@ class ProblemReportViewController: UIViewController, UITextFieldDelegate, Condit
}
private func presentEmptyEmailConfirmationAlert(completion: @escaping (Bool) -> Void) {
- let message = NSLocalizedString("You are about to send the problem report without a way for us to get back to you. If you want an answer to your report you will have to enter an email address.", comment: "")
+ let message = NSLocalizedString(
+ "EMPTY_EMAIL_ALERT_MESSAGE",
+ tableName: "ProblemReport",
+ comment: "Alert message warning users that they atttempt to send problem report without email address filled in."
+ )
let alertController = UIAlertController(title: nil, message: message, preferredStyle: .alert)
- let cancelAction = UIAlertAction(title: NSLocalizedString("Cancel", comment: ""), style: .cancel) { _ in
+ let cancelAction = UIAlertAction(title: NSLocalizedString(
+ "EMPTY_EMAIL_ALERT_CANCEL_ACTION",
+ tableName: "ProblemReport",
+ comment: "Cancel button."
+ ), style: .cancel) { _ in
completion(false)
}
- let sendAction = UIAlertAction(title: NSLocalizedString("Send anyway", comment: ""), style: .destructive) { _ in
+ let sendAction = UIAlertAction(title: NSLocalizedString(
+ "EMPTY_EMAIL_ALERT_SEND_ANYWAY_ACTION",
+ tableName: "ProblemReport",
+ comment: "Title for button to send problem report without email address filled in."
+ ), style: .destructive) { _ in
completion(true)
}
diff --git a/ios/MullvadVPN/en.lproj/ProblemReport.strings b/ios/MullvadVPN/en.lproj/ProblemReport.strings
new file mode 100644
index 0000000000..77925ca36a
--- /dev/null
+++ b/ios/MullvadVPN/en.lproj/ProblemReport.strings
@@ -0,0 +1,50 @@
+/* No comment provided by engineer. */
+"CONTACT_BACK_EMAIL_MESSAGE_FORMAT" = "If needed we will contact you on %@";
+
+/* Placeholder for description text view. */
+"DESCRIPTION_TEXTVIEW_PLACEHOLDER" = "Please describe your problem in English or Swedish";
+
+/* No comment provided by engineer. */
+"EDIT_MESSAGE_BUTTON" = "Edit message";
+
+/* Placeholder for email text field. */
+"EMAIL_TEXTFIELD_PLACEHOLDER" = "Your email (optional)";
+
+/* Cancel button. */
+"EMPTY_EMAIL_ALERT_CANCEL_ACTION" = "Cancel";
+
+/* Alert message warning users that they atttempt to send problem report without email address filled in. */
+"EMPTY_EMAIL_ALERT_MESSAGE" = "You are about to send the problem report without a way for us to get back to you. If you want an answer to your report you will have to enter an email address.";
+
+/* Title for button to send problem report without email address filled in. */
+"EMPTY_EMAIL_ALERT_SEND_ANYWAY_ACTION" = "Send anyway";
+
+/* Navigation title */
+"NAVIGATION_TITLE" = "Report a problem";
+
+/* Title for button to send problem report. */
+"SEND_BUTTON_TITLE" = "Send";
+
+/* Subhead label displayed below navigation title. */
+"SUBHEAD_LABEL" = "To help you more effectively, your app's log file will be attached to this message. Your data will remain secure and private, as it is anonymised before being sent over an encrypted channel.";
+
+/* No comment provided by engineer. */
+"SUBMISSION_STATUS_FAILURE" = "Failed to send";
+
+/* No comment provided by engineer. */
+"SUBMISSION_STATUS_SENDING" = "Sending...";
+
+/* No comment provided by engineer. */
+"SUBMISSION_STATUS_SENT" = "Sent";
+
+/* No comment provided by engineer. */
+"THANKS_MESSAGE" = "Thanks!";
+
+/* No comment provided by engineer. */
+"TRY_AGAIN_BUTTON" = "Try again";
+
+/* Title for button to view application logs */
+"VIEW_APP_LOGS_BUTTON_TITLE" = "View app logs";
+
+/* No comment provided by engineer. */
+"WE_WILL_LOOK_INTO_THIS_MESSAGE" = "We will look into this.";