Skip to content

Commit 163b211

Browse files
authored
Localize outgoing restore prompts
1 parent f11f9d5 commit 163b211

File tree

3 files changed

+57
-13
lines changed

3 files changed

+57
-13
lines changed

Signal/DeviceTransfer/OutgoingDeviceRestorePresenter.swift

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,14 @@ class OutgoingDeviceRestorePresenter: OutgoingDeviceRestoreInitialPresenter {
5656
private func presentSheet() {
5757
let sheet = HeroSheetViewController(
5858
hero: .image(UIImage(named: "other-device")!),
59-
// TODO: [Backups] - Localize
60-
title: LocalizationNotNeeded("Continue on your other device"),
61-
body: LocalizationNotNeeded("Continue transferring your account on your other device."),
59+
title: OWSLocalizedString(
60+
"OUTGOING_DEVICE_RESTORE_CONTINUE_ON_OTHER_DEVICE_TITLE",
61+
comment: "Title of prompt notifying that action is necessary on the other device."
62+
),
63+
body: OWSLocalizedString(
64+
"OUTGOING_DEVICE_RESTORE_CONTINUE_ON_OTHER_DEVICE_BODY",
65+
comment: "Body of prompt notifying that action is necessary on the other device."
66+
),
6267
primary: .hero(.animation(named: "circular_indeterminate", height: 60))
6368
)
6469
sheet.modalPresentationStyle = .formSheet
@@ -82,10 +87,15 @@ class OutgoingDeviceRestorePresenter: OutgoingDeviceRestoreInitialPresenter {
8287
private func displayTransferComplete(presentingViewController: UIViewController) async {
8388
let sheet = HeroSheetViewController(
8489
hero: .image(UIImage(resource: .checkCircle)),
85-
// TODO: [Backups] - Localize
86-
title: LocalizationNotNeeded("Transfer complete"),
87-
body: LocalizationNotNeeded("Your Signal account and messages have been transferred to your other device. Signal is now inactive on this device."),
88-
primaryButton: .dismissing(title: "Okay")
90+
title: OWSLocalizedString(
91+
"OUTGOING_DEVICE_TRANSFER_COMPLETE_TITLE",
92+
comment: "Title of prompt notifying device transfer completed."
93+
),
94+
body: OWSLocalizedString(
95+
"OUTGOING_DEVICE_TRANSFER_COMPLETE_BODY",
96+
comment: "Body of prompt notifying device transfer completed."
97+
),
98+
primaryButton: .dismissing(title: CommonStrings.okayButton)
8999
)
90100
sheet.modalPresentationStyle = .formSheet
91101
await presentingViewController.awaitablePresent(sheet, animated: true)
@@ -94,16 +104,27 @@ class OutgoingDeviceRestorePresenter: OutgoingDeviceRestoreInitialPresenter {
94104
@MainActor
95105
private func displayRestoreMessage(isBackup: Bool, presentingViewController: UIViewController) async {
96106

97-
// TODO: [Backups] - Localize
98107
let (title, body) = if isBackup {
99108
(
100-
LocalizationNotNeeded("Restore complete"),
101-
LocalizationNotNeeded("Your Signal account and messages have started transferring to your other device. Signal is now inactive on this device.")
109+
OWSLocalizedString(
110+
"OUTGOING_DEVICE_RESTORE_COMPLETE_TITLE",
111+
comment: "Title of prompt notifying device restore started on the new device."
112+
),
113+
OWSLocalizedString(
114+
"OUTGOING_DEVICE_RESTORE_COMPLETE_BODY",
115+
comment: "Body of prompt notifying device restore started on the new device."
116+
)
102117
)
103118
} else {
104119
(
105-
LocalizationNotNeeded("Registration complete"),
106-
LocalizationNotNeeded("Your Signal account has been activated on your other device. Signal is now inactive on this device.")
120+
OWSLocalizedString(
121+
"OUTGOING_DEVICE_REGISTRATION_COMPLETE_TITLE",
122+
comment: "Title of prompt notifying registration without restore completed on the new device."
123+
),
124+
OWSLocalizedString(
125+
"OUTGOING_DEVICE_REGISTRATION_COMPLETE_BODY",
126+
comment: "Body of prompt notifying registration without restore completed on the new device."
127+
)
107128
)
108129
}
109130

Signal/Registration/UserInterface/RegistrationTransferStatusViewController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class RegistrationTransferStatusViewController: HostingController<TransferStatus
4747
primaryButton: .init(
4848
title: CommonStrings.okayButton
4949
) { _ in
50-
// TODO: [Backups] - This should be handled through the presenter
5150
Task {
5251
SSKEnvironment.shared.notificationPresenterRef.notifyUserToRelaunchAfterTransfer {
5352
Logger.info("Deliberately terminating app post-transfer.")

Signal/translations/en.lproj/Localizable.strings

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5581,6 +5581,24 @@
55815581
/* Label warning the user that they should update Signal to continue using payments. */
55825582
"OUTDATED_PAYMENT_CLIENT_REMINDER_TEXT" = "Update Signal to continue using payments. Your balance may not be up-to-date.";
55835583

5584+
/* Body of prompt notifying registration without restore completed on the new device. */
5585+
"OUTGOING_DEVICE_REGISTRATION_COMPLETE_BODY" = "Your Signal account has been activated on your other device. Signal is now inactive on this device.";
5586+
5587+
/* Title of prompt notifying registration without restore completed on the new device. */
5588+
"OUTGOING_DEVICE_REGISTRATION_COMPLETE_TITLE" = "Registration complete";
5589+
5590+
/* Body of prompt notifying device restore started on the new device. */
5591+
"OUTGOING_DEVICE_RESTORE_COMPLETE_BODY" = "Your Signal account and messages have started transferring to your other device. Signal is now inactive on this device.";
5592+
5593+
/* Title of prompt notifying device restore started on the new device. */
5594+
"OUTGOING_DEVICE_RESTORE_COMPLETE_TITLE" = "Restore complete";
5595+
5596+
/* Body of prompt notifying that action is necessary on the other device. */
5597+
"OUTGOING_DEVICE_RESTORE_CONTINUE_ON_OTHER_DEVICE_BODY" = "Continue transferring your account on your other device.";
5598+
5599+
/* Title of prompt notifying that action is necessary on the other device. */
5600+
"OUTGOING_DEVICE_RESTORE_CONTINUE_ON_OTHER_DEVICE_TITLE" = "Continue on your other device";
5601+
55845602
/* Body text describing the outgoing transfer. */
55855603
"OUTGOING_DEVICE_RESTORE_INITIAL_VIEW_BODY" = "Your account will be transferred to a new device. This device will be able to see your groups and contacts, access your chats, and send messages in your name.";
55865604

@@ -5593,6 +5611,12 @@
55935611
/* Title text describing the outgoing transfer. */
55945612
"OUTGOING_DEVICE_RESTORE_INITIAL_VIEW_TITLE" = "Transfer Account";
55955613

5614+
/* Body of prompt notifying device transfer completed. */
5615+
"OUTGOING_DEVICE_TRANSFER_COMPLETE_BODY" = "Your Signal account and messages have been transferred to your other device. Signal is now inactive on this device.";
5616+
5617+
/* Title of prompt notifying device transfer completed. */
5618+
"OUTGOING_DEVICE_TRANSFER_COMPLETE_TITLE" = "Transfer complete";
5619+
55965620
/* info message text in conversation view */
55975621
"OUTGOING_MISSED_VIDEO_CALL" = "Unanswered video call";
55985622

0 commit comments

Comments
 (0)