From bc4a4a944ebd23278587343bf94cea8cb9356972 Mon Sep 17 00:00:00 2001 From: Bruno Muniz Azevedo Filho <bruno@elixxir.io> Date: Tue, 28 Jun 2022 03:23:06 -0300 Subject: [PATCH] Fixed localization for contact delete --- .../Controllers/ContactController.swift | 13 +++++++------ Sources/Shared/AutoGenerated/Strings.swift | 14 ++++++++++++++ .../Shared/Resources/en.lproj/Localizable.strings | 9 +++++++++ 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Sources/ContactFeature/Controllers/ContactController.swift b/Sources/ContactFeature/Controllers/ContactController.swift index 1ef8e96f..cf64268e 100644 --- a/Sources/ContactFeature/Controllers/ContactController.swift +++ b/Sources/ContactFeature/Controllers/ContactController.swift @@ -263,7 +263,7 @@ public final class ContactController: UIViewController { let deleteButton = RowButton() deleteButton.setup( - title: "Delete Connection", + title: Localized.Contact.Delete.Info.title, icon: Asset.settingsDelete.image, style: .delete, separator: false @@ -411,22 +411,23 @@ extension ContactController { private func presentDeleteInfo() { let actionButton = DrawerCapsuleButton(model: .init( - title: "Delete Connection", + title: Localized.Contact.Delete.Info.title, style: .red )) let drawer = DrawerController(with: [ DrawerText( font: Fonts.Mulish.bold.font(size: 26.0), - text: "Delete Connection?", + text: Localized.Contact.Delete.Drawer.title, color: Asset.neutralActive.color, alignment: .left, spacingAfter: 19 ), DrawerText( - text: "This is a silent deletion, \(viewModel.contact.username) will not know you deleted them. This action will remove all information on your phone about this user, including your communications. You #cannot undo this step, and cannot re-add them unless they delete you as a connection as well.#", - spacingAfter: 37 - ), + text: Localized.Contact.Delete.Drawer.description(viewModel.contact.username ?? ""), + spacingAfter: 37, + customAttributes: [.font: Fonts.Mulish.bold.font(size: 16.0)] + ), actionButton ]) diff --git a/Sources/Shared/AutoGenerated/Strings.swift b/Sources/Shared/AutoGenerated/Strings.swift index 755693f3..07f2cee0 100644 --- a/Sources/Shared/AutoGenerated/Strings.swift +++ b/Sources/Shared/AutoGenerated/Strings.swift @@ -455,6 +455,20 @@ public enum Localized { /// Send message public static let send = Localized.tr("Localizable", "contact.confirmed.send") } + public enum Delete { + public enum Drawer { + /// This is a silent deletion, %@ will not know you deleted them. This action will remove all information on your phone about this user, including your communications. You #cannot undo this step, and cannot re-add them unless they delete you as a connection as well.# + public static func description(_ p1: Any) -> String { + return Localized.tr("Localizable", "contact.delete.drawer.description", String(describing: p1)) + } + /// Delete Connection? + public static let title = Localized.tr("Localizable", "contact.delete.drawer.title") + } + public enum Info { + /// Delete Connection + public static let title = Localized.tr("Localizable", "contact.delete.info.title") + } + } public enum Inprogress { /// Your request failed to send public static let failed = Localized.tr("Localizable", "contact.inprogress.failed") diff --git a/Sources/Shared/Resources/en.lproj/Localizable.strings b/Sources/Shared/Resources/en.lproj/Localizable.strings index 774e9759..aebff7b7 100644 --- a/Sources/Shared/Resources/en.lproj/Localizable.strings +++ b/Sources/Shared/Resources/en.lproj/Localizable.strings @@ -230,6 +230,15 @@ "contact.nickname" = "Nickname"; +// ContactFeature - Delete + +"contact.delete.info.title" += "Delete Connection"; +"contact.delete.drawer.title" += "Delete Connection?"; +"contact.delete.drawer.description" += "This is a silent deletion, %@ will not know you deleted them. This action will remove all information on your phone about this user, including your communications. You #cannot undo this step, and cannot re-add them unless they delete you as a connection as well.#"; + // ContactFeature - Confirmed "contact.confirmed.clear" -- GitLab