From 72873fbfc1d22ba86d3b1eb227164058a2c08e43 Mon Sep 17 00:00:00 2001 From: David Godfrey Date: Sat, 12 Nov 2022 02:40:19 +0000 Subject: [PATCH] Use localisable strings in verified modal --- Localization/app.json | 4 ++++ Mastodon/Diffiable/Profile/ProfileFieldSection.swift | 2 +- Mastodon/Scene/Profile/ProfileViewController.swift | 2 +- .../Sources/MastodonLocalization/Generated/Strings.swift | 8 ++++++++ .../Resources/en.lproj/Localizable.strings | 4 +++- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Localization/app.json b/Localization/app.json index c5a3dac74..6ca2cbea9 100644 --- a/Localization/app.json +++ b/Localization/app.json @@ -51,6 +51,10 @@ "clean_cache": { "title": "Clean Cache", "message": "Successfully cleaned %s cache." + }, + "verified": { + "title": "Verified", + "message": "Ownership of this link was checked on %s" } }, "controls": { diff --git a/Mastodon/Diffiable/Profile/ProfileFieldSection.swift b/Mastodon/Diffiable/Profile/ProfileFieldSection.swift index 87f730fa8..01e8d8a0a 100644 --- a/Mastodon/Diffiable/Profile/ProfileFieldSection.swift +++ b/Mastodon/Diffiable/Profile/ProfileFieldSection.swift @@ -74,7 +74,7 @@ extension ProfileFieldSection { let formatter = DateFormatter() formatter.dateStyle = .medium 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 diff --git a/Mastodon/Scene/Profile/ProfileViewController.swift b/Mastodon/Scene/Profile/ProfileViewController.swift index 70d11a823..1faf291f3 100644 --- a/Mastodon/Scene/Profile/ProfileViewController.swift +++ b/Mastodon/Scene/Profile/ProfileViewController.swift @@ -863,7 +863,7 @@ extension ProfileViewController: ProfileAboutViewControllerDelegate { let formatter = DateFormatter() formatter.dateStyle = .medium 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.dismiss(animated: true) }) diff --git a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift index 44ae29267..fce4d9733 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift +++ b/MastodonSDK/Sources/MastodonLocalization/Generated/Strings.swift @@ -87,6 +87,14 @@ public enum L10n { /// Sign Up Failure 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) -> 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 { /// The poll has ended public static let pollEnded = L10n.tr("Localizable", "Common.Alerts.VoteFailure.PollEnded") diff --git a/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings b/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings index 9114b96e5..fe9566b14 100644 --- a/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings +++ b/MastodonSDK/Sources/MastodonLocalization/Resources/en.lproj/Localizable.strings @@ -22,6 +22,8 @@ Please check your internet connection."; "Common.Alerts.SignOut.Message" = "Are you sure you want to sign out?"; "Common.Alerts.SignOut.Title" = "Sign Out"; "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.Title" = "Vote Failure"; "Common.Controls.Actions.Add" = "Add"; @@ -448,4 +450,4 @@ uploaded to Mastodon."; back in your hands."; "Scene.Wizard.AccessibilityHint" = "Double tap to dismiss this wizard"; "Scene.Wizard.MultipleAccountSwitchIntroDescription" = "Switch between multiple accounts by holding the profile button."; -"Scene.Wizard.NewInMastodon" = "New in Mastodon"; \ No newline at end of file +"Scene.Wizard.NewInMastodon" = "New in Mastodon";