Use localisable strings in verified modal

This commit is contained in:
David Godfrey 2022-11-12 02:40:19 +00:00
parent b0a0aa268f
commit 72873fbfc1
5 changed files with 17 additions and 3 deletions

View File

@ -51,6 +51,10 @@
"clean_cache": { "clean_cache": {
"title": "Clean Cache", "title": "Clean Cache",
"message": "Successfully cleaned %s cache." "message": "Successfully cleaned %s cache."
},
"verified": {
"title": "Verified",
"message": "Ownership of this link was checked on %s"
} }
}, },
"controls": { "controls": {

View File

@ -74,7 +74,7 @@ extension ProfileFieldSection {
let formatter = DateFormatter() let formatter = DateFormatter()
formatter.dateStyle = .medium formatter.dateStyle = .medium
formatter.timeStyle = .short formatter.timeStyle = .short
cell.checkmark.accessibilityLabel = "Ownership of this link was checked on \(formatter.string(from: verifiedAt))" // TODO: I18N / L10N cell.checkmark.accessibilityLabel = L10n.Common.Alerts.Verified.message(formatter.string(from: verifiedAt))
} }
cell.delegate = configuration.profileFieldCollectionViewCellDelegate cell.delegate = configuration.profileFieldCollectionViewCellDelegate

View File

@ -863,7 +863,7 @@ extension ProfileViewController: ProfileAboutViewControllerDelegate {
let formatter = DateFormatter() let formatter = DateFormatter()
formatter.dateStyle = .medium formatter.dateStyle = .medium
formatter.timeStyle = .short formatter.timeStyle = .short
let alert = UIAlertController(title: "Verified", message: "Ownership of this link was checked on \(formatter.string(from: verifiedAt))", preferredStyle: .alert) // TODO: I18N / L10N let alert = UIAlertController(title: L10n.Common.Alerts.Verified.title, message: L10n.Common.Alerts.Verified.message(formatter.string(from: verifiedAt)), preferredStyle: .alert)
alert.addAction(UIAlertAction(title: L10n.Common.Controls.Actions.ok, style: .default) { _ in alert.addAction(UIAlertAction(title: L10n.Common.Controls.Actions.ok, style: .default) { _ in
alert.dismiss(animated: true) alert.dismiss(animated: true)
}) })

View File

@ -87,6 +87,14 @@ public enum L10n {
/// Sign Up Failure /// Sign Up Failure
public static let title = L10n.tr("Localizable", "Common.Alerts.SignUpFailure.Title") public static let title = L10n.tr("Localizable", "Common.Alerts.SignUpFailure.Title")
} }
public enum Verified {
/// Ownership of this link was checked on %s
public static func message(_ p1: UnsafePointer<CChar>) -> String {
return L10n.tr("Localizable", "Common.Alerts.Verified.Message", p1)
}
/// Verified
public static let title = L10n.tr("Localizable", "Common.Alerts.Verified.Title")
}
public enum VoteFailure { public enum VoteFailure {
/// The poll has ended /// The poll has ended
public static let pollEnded = L10n.tr("Localizable", "Common.Alerts.VoteFailure.PollEnded") public static let pollEnded = L10n.tr("Localizable", "Common.Alerts.VoteFailure.PollEnded")

View File

@ -22,6 +22,8 @@ Please check your internet connection.";
"Common.Alerts.SignOut.Message" = "Are you sure you want to sign out?"; "Common.Alerts.SignOut.Message" = "Are you sure you want to sign out?";
"Common.Alerts.SignOut.Title" = "Sign Out"; "Common.Alerts.SignOut.Title" = "Sign Out";
"Common.Alerts.SignUpFailure.Title" = "Sign Up Failure"; "Common.Alerts.SignUpFailure.Title" = "Sign Up Failure";
"Common.Alerts.Verified.Title" = "Verified";
"Common.Alerts.Verified.Message" = "Ownership of this link was checked on %s";
"Common.Alerts.VoteFailure.PollEnded" = "The poll has ended"; "Common.Alerts.VoteFailure.PollEnded" = "The poll has ended";
"Common.Alerts.VoteFailure.Title" = "Vote Failure"; "Common.Alerts.VoteFailure.Title" = "Vote Failure";
"Common.Controls.Actions.Add" = "Add"; "Common.Controls.Actions.Add" = "Add";