From 3b07be4eed110ed415af20ae31bddf03ea7338a8 Mon Sep 17 00:00:00 2001 From: Morgan Pretty Date: Thu, 13 Jan 2022 16:37:23 +1100 Subject: [PATCH] Fixed a couple of crashes Fixed an issue where sharing form Safari without adding comments would result in an invalid message getting sent. Fixed a crash when sharing plain text from safari. Fixed a crash when localising 'OK' (key and value can't be the same when using the new extension). --- Session/Closed Groups/EditClosedGroupVC.swift | 2 +- Session/Closed Groups/NewClosedGroupVC.swift | 4 ++-- .../Views & Modals/JoinOpenGroupModal.swift | 4 ++-- Session/DMs/NewDMVC.swift | 2 +- .../Meta/Translations/de.lproj/Localizable.strings | 2 +- .../Meta/Translations/en.lproj/Localizable.strings | 2 +- .../Meta/Translations/es.lproj/Localizable.strings | 2 +- .../Meta/Translations/fa.lproj/Localizable.strings | 2 +- .../Meta/Translations/fi.lproj/Localizable.strings | 2 +- .../Meta/Translations/fr.lproj/Localizable.strings | 2 +- .../Meta/Translations/hi.lproj/Localizable.strings | 2 +- .../Meta/Translations/hr.lproj/Localizable.strings | 2 +- .../Translations/id-ID.lproj/Localizable.strings | 2 +- .../Meta/Translations/it.lproj/Localizable.strings | 2 +- .../Meta/Translations/ja.lproj/Localizable.strings | 2 +- .../Meta/Translations/nl.lproj/Localizable.strings | 2 +- .../Meta/Translations/pl.lproj/Localizable.strings | 2 +- .../Translations/pt_BR.lproj/Localizable.strings | 2 +- .../Meta/Translations/ru.lproj/Localizable.strings | 2 +- .../Meta/Translations/si.lproj/Localizable.strings | 2 +- .../Meta/Translations/sk.lproj/Localizable.strings | 2 +- .../Meta/Translations/sv.lproj/Localizable.strings | 2 +- .../Meta/Translations/th.lproj/Localizable.strings | 2 +- .../Translations/vi-VN.lproj/Localizable.strings | 2 +- .../Translations/zh-Hant.lproj/Localizable.strings | 2 +- .../Translations/zh_CN.lproj/Localizable.strings | 2 +- Session/Onboarding/DisplayNameVC.swift | 2 +- Session/Onboarding/LinkDeviceVC.swift | 4 ++-- Session/Onboarding/PNModeVC.swift | 2 +- Session/Onboarding/RestoreVC.swift | 2 +- Session/Open Groups/JoinOpenGroupVC.swift | 2 +- Session/Settings/NukeDataModal.swift | 4 ++-- Session/Settings/QRCodeVC.swift | 2 +- Session/Settings/SettingsVC.swift | 4 ++-- SessionShareExtension/ShareVC.swift | 2 +- SessionShareExtension/ThreadPickerVC.swift | 12 ++++++++++-- .../AttachmentApprovalInputAccessoryView.swift | 1 + .../Media Viewing & Editing/MediaMessageView.swift | 3 +++ SignalUtilitiesKit/Messaging/BlockListUIUtils.m | 2 +- SignalUtilitiesKit/Utilities/OWSAlerts.swift | 4 ++-- 40 files changed, 57 insertions(+), 45 deletions(-) diff --git a/Session/Closed Groups/EditClosedGroupVC.swift b/Session/Closed Groups/EditClosedGroupVC.swift index 0e46f9f48..3a74dea3e 100644 --- a/Session/Closed Groups/EditClosedGroupVC.swift +++ b/Session/Closed Groups/EditClosedGroupVC.swift @@ -306,7 +306,7 @@ final class EditClosedGroupVC : BaseVC, UITableViewDataSource, UITableViewDelega // MARK: Convenience private func showError(title: String, message: String = "") { let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment: ""), style: .default, handler: nil)) presentAlert(alert) } } diff --git a/Session/Closed Groups/NewClosedGroupVC.swift b/Session/Closed Groups/NewClosedGroupVC.swift index 0489b556f..47fbbff43 100644 --- a/Session/Closed Groups/NewClosedGroupVC.swift +++ b/Session/Closed Groups/NewClosedGroupVC.swift @@ -151,7 +151,7 @@ final class NewClosedGroupVC : BaseVC, UITableViewDataSource, UITableViewDelegat @objc private func createClosedGroup() { func showError(title: String, message: String = "") { let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment: ""), style: .default, handler: nil)) presentAlert(alert) } guard let name = nameTextField.text?.trimmingCharacters(in: .whitespacesAndNewlines), name.count > 0 else { @@ -184,7 +184,7 @@ final class NewClosedGroupVC : BaseVC, UITableViewDataSource, UITableViewDelegat let title = "Couldn't Create Group" let message = "Please check your internet connection and try again." let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment: ""), style: .default, handler: nil)) self?.presentAlert(alert) } } diff --git a/Session/Conversations/Views & Modals/JoinOpenGroupModal.swift b/Session/Conversations/Views & Modals/JoinOpenGroupModal.swift index 0e319ae25..d6a47a02b 100644 --- a/Session/Conversations/Views & Modals/JoinOpenGroupModal.swift +++ b/Session/Conversations/Views & Modals/JoinOpenGroupModal.swift @@ -65,7 +65,7 @@ final class JoinOpenGroupModal : Modal { @objc private func joinOpenGroup() { guard let (room, server, publicKey) = OpenGroupManagerV2.parseV2OpenGroup(from: url) else { let alert = UIAlertController(title: "Couldn't Join", message: nil, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment: ""), style: .default, handler: nil)) return presentingViewController!.present(alert, animated: true, completion: nil) } presentingViewController!.dismiss(animated: true, completion: nil) @@ -77,7 +77,7 @@ final class JoinOpenGroupModal : Modal { } .catch(on: DispatchQueue.main) { error in let alert = UIAlertController(title: "Couldn't Join", message: error.localizedDescription, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment: ""), style: .default, handler: nil)) presentingViewController.present(alert, animated: true, completion: nil) } } diff --git a/Session/DMs/NewDMVC.swift b/Session/DMs/NewDMVC.swift index e0f2eaa40..e98a5b02e 100644 --- a/Session/DMs/NewDMVC.swift +++ b/Session/DMs/NewDMVC.swift @@ -158,7 +158,7 @@ final class NewDMVC : BaseVC, UIPageViewControllerDataSource, UIPageViewControll } let message = messageOrNil ?? "Please check the Session ID or ONS name and try again" let alert = UIAlertController(title: "Error", message: message, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment: ""), style: .default, handler: nil)) self?.presentAlert(alert) } } diff --git a/Session/Meta/Translations/de.lproj/Localizable.strings b/Session/Meta/Translations/de.lproj/Localizable.strings index 6491893af..ac1f796fe 100644 --- a/Session/Meta/Translations/de.lproj/Localizable.strings +++ b/Session/Meta/Translations/de.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "Anzeigen"; /* No comment provided by engineer. */ -"OK" = "Okay"; +"BUTTON_OK" = "Okay"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ hat verschwindende Nachrichten deaktiviert."; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/en.lproj/Localizable.strings b/Session/Meta/Translations/en.lproj/Localizable.strings index 0777460b8..cb912599d 100644 --- a/Session/Meta/Translations/en.lproj/Localizable.strings +++ b/Session/Meta/Translations/en.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "Show"; /* No comment provided by engineer. */ -"OK" = "OK"; +"BUTTON_OK" = "OK"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ disabled disappearing messages."; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/es.lproj/Localizable.strings b/Session/Meta/Translations/es.lproj/Localizable.strings index 6667e411a..ff1356af6 100644 --- a/Session/Meta/Translations/es.lproj/Localizable.strings +++ b/Session/Meta/Translations/es.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "Ver"; /* No comment provided by engineer. */ -"OK" = "OK"; +"BUTTON_OK" = "OK"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ ha desactivado la desaparición de mensajes."; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/fa.lproj/Localizable.strings b/Session/Meta/Translations/fa.lproj/Localizable.strings index 4043f5f66..50cac47b5 100644 --- a/Session/Meta/Translations/fa.lproj/Localizable.strings +++ b/Session/Meta/Translations/fa.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "نمایش"; /* No comment provided by engineer. */ -"OK" = "باشه"; +"BUTTON_OK" = "باشه"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ پیام‌های محوشونده را غیرفعال کرده است."; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/fi.lproj/Localizable.strings b/Session/Meta/Translations/fi.lproj/Localizable.strings index 286ec23f9..21457f99b 100644 --- a/Session/Meta/Translations/fi.lproj/Localizable.strings +++ b/Session/Meta/Translations/fi.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "Näytä"; /* No comment provided by engineer. */ -"OK" = "Ok"; +"BUTTON_OK" = "Ok"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ poisti katoavat viestit käytöstä."; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/fr.lproj/Localizable.strings b/Session/Meta/Translations/fr.lproj/Localizable.strings index 0e818d2ed..615fb8779 100644 --- a/Session/Meta/Translations/fr.lproj/Localizable.strings +++ b/Session/Meta/Translations/fr.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "Afficher"; /* No comment provided by engineer. */ -"OK" = "Valider"; +"BUTTON_OK" = "Valider"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ a désactivé les messages éphémères."; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/hi.lproj/Localizable.strings b/Session/Meta/Translations/hi.lproj/Localizable.strings index daa874af6..d53d15728 100644 --- a/Session/Meta/Translations/hi.lproj/Localizable.strings +++ b/Session/Meta/Translations/hi.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "दिखाएं"; /* No comment provided by engineer. */ -"OK" = "ठीक है"; +"BUTTON_OK" = "ठीक है"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ ने गायब संदेश अक्षम कर दिए हैं।"; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/hr.lproj/Localizable.strings b/Session/Meta/Translations/hr.lproj/Localizable.strings index 207e01f7a..befd956ac 100644 --- a/Session/Meta/Translations/hr.lproj/Localizable.strings +++ b/Session/Meta/Translations/hr.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "Prikaži"; /* No comment provided by engineer. */ -"OK" = "OK"; +"BUTTON_OK" = "OK"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ je onemogućio nestajuće poruke."; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/id-ID.lproj/Localizable.strings b/Session/Meta/Translations/id-ID.lproj/Localizable.strings index 46a837990..5cef83fe6 100644 --- a/Session/Meta/Translations/id-ID.lproj/Localizable.strings +++ b/Session/Meta/Translations/id-ID.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "Tampilkan"; /* No comment provided by engineer. */ -"OK" = "OK"; +"BUTTON_OK" = "OK"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@menonaktifkan pesan tersembunyi"; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/it.lproj/Localizable.strings b/Session/Meta/Translations/it.lproj/Localizable.strings index 80ddd24a3..b185d7686 100644 --- a/Session/Meta/Translations/it.lproj/Localizable.strings +++ b/Session/Meta/Translations/it.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "Mostra"; /* No comment provided by engineer. */ -"OK" = "OK,"; +"BUTTON_OK" = "OK,"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ ha disabilitato la scomparsa dei messaggi."; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/ja.lproj/Localizable.strings b/Session/Meta/Translations/ja.lproj/Localizable.strings index c5fa17a3d..8667f8fe3 100644 --- a/Session/Meta/Translations/ja.lproj/Localizable.strings +++ b/Session/Meta/Translations/ja.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "表示内容"; /* No comment provided by engineer. */ -"OK" = "確定"; +"BUTTON_OK" = "確定"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@がメッセージの消失をオフにしました"; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/nl.lproj/Localizable.strings b/Session/Meta/Translations/nl.lproj/Localizable.strings index 596408937..a90e162bb 100644 --- a/Session/Meta/Translations/nl.lproj/Localizable.strings +++ b/Session/Meta/Translations/nl.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "Tonen"; /* No comment provided by engineer. */ -"OK" = "OK"; +"BUTTON_OK" = "OK"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ heeft zelf-wissende berichten uitgeschakeld."; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/pl.lproj/Localizable.strings b/Session/Meta/Translations/pl.lproj/Localizable.strings index 5c1dd6c87..869fed251 100644 --- a/Session/Meta/Translations/pl.lproj/Localizable.strings +++ b/Session/Meta/Translations/pl.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "Pokaż"; /* No comment provided by engineer. */ -"OK" = "OK"; +"BUTTON_OK" = "OK"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ wyłączył(a) znikające wiadomości."; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/pt_BR.lproj/Localizable.strings b/Session/Meta/Translations/pt_BR.lproj/Localizable.strings index 1660b1d1f..3acb3060f 100644 --- a/Session/Meta/Translations/pt_BR.lproj/Localizable.strings +++ b/Session/Meta/Translations/pt_BR.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "Exibir"; /* No comment provided by engineer. */ -"OK" = "OK"; +"BUTTON_OK" = "OK"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ desabilitou mensagens efêmeras."; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/ru.lproj/Localizable.strings b/Session/Meta/Translations/ru.lproj/Localizable.strings index 7f1c3b06d..ae19b824a 100644 --- a/Session/Meta/Translations/ru.lproj/Localizable.strings +++ b/Session/Meta/Translations/ru.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "Показывать"; /* No comment provided by engineer. */ -"OK" = "Ок"; +"BUTTON_OK" = "Ок"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ отключил(а) исчезающие сообщения."; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/si.lproj/Localizable.strings b/Session/Meta/Translations/si.lproj/Localizable.strings index 546914d38..b2d4849c7 100644 --- a/Session/Meta/Translations/si.lproj/Localizable.strings +++ b/Session/Meta/Translations/si.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "Show"; /* No comment provided by engineer. */ -"OK" = "OK"; +"BUTTON_OK" = "OK"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ disabled disappearing messages."; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/sk.lproj/Localizable.strings b/Session/Meta/Translations/sk.lproj/Localizable.strings index 5bc10ae49..a225890fd 100644 --- a/Session/Meta/Translations/sk.lproj/Localizable.strings +++ b/Session/Meta/Translations/sk.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "Zobraziť"; /* No comment provided by engineer. */ -"OK" = "OK"; +"BUTTON_OK" = "OK"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ disabled disappearing messages."; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/sv.lproj/Localizable.strings b/Session/Meta/Translations/sv.lproj/Localizable.strings index 15185fc1f..e3e3fdb36 100644 --- a/Session/Meta/Translations/sv.lproj/Localizable.strings +++ b/Session/Meta/Translations/sv.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "Visa"; /* No comment provided by engineer. */ -"OK" = "OK"; +"BUTTON_OK" = "OK"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ inaktiverade försvinnande meddelanden."; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/th.lproj/Localizable.strings b/Session/Meta/Translations/th.lproj/Localizable.strings index d57365cb9..a4e943ecd 100644 --- a/Session/Meta/Translations/th.lproj/Localizable.strings +++ b/Session/Meta/Translations/th.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "แสดง"; /* No comment provided by engineer. */ -"OK" = "ตกลง"; +"BUTTON_OK" = "ตกลง"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ ได้ปิดใช้งานข้อความที่ลบตัวเองแล้ว"; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/vi-VN.lproj/Localizable.strings b/Session/Meta/Translations/vi-VN.lproj/Localizable.strings index 0d4da6bba..4c29a785f 100644 --- a/Session/Meta/Translations/vi-VN.lproj/Localizable.strings +++ b/Session/Meta/Translations/vi-VN.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "Show"; /* No comment provided by engineer. */ -"OK" = "OK"; +"BUTTON_OK" = "OK"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ disabled disappearing messages."; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings b/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings index efd1716a2..d4b6922aa 100644 --- a/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings +++ b/Session/Meta/Translations/zh-Hant.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "顯示"; /* No comment provided by engineer. */ -"OK" = "OK"; +"BUTTON_OK" = "OK"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ 取消了閱後即焚模式"; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Meta/Translations/zh_CN.lproj/Localizable.strings b/Session/Meta/Translations/zh_CN.lproj/Localizable.strings index 9f734e00d..359a12684 100644 --- a/Session/Meta/Translations/zh_CN.lproj/Localizable.strings +++ b/Session/Meta/Translations/zh_CN.lproj/Localizable.strings @@ -269,7 +269,7 @@ /* No comment provided by engineer. */ "NOTIFICATIONS_SHOW" = "显示"; /* No comment provided by engineer. */ -"OK" = "好"; +"BUTTON_OK" = "好"; /* Info Message when {{other user}} disables or doesn't support disappearing messages */ "OTHER_DISABLED_DISAPPEARING_MESSAGES_CONFIGURATION" = "%@ 取消了阅后即焚。"; /* Info Message when {{other user}} updates message expiration to {{time amount}}, see the *_TIME_AMOUNT strings for context. */ diff --git a/Session/Onboarding/DisplayNameVC.swift b/Session/Onboarding/DisplayNameVC.swift index fd6e0ce28..0fdf23c90 100644 --- a/Session/Onboarding/DisplayNameVC.swift +++ b/Session/Onboarding/DisplayNameVC.swift @@ -124,7 +124,7 @@ final class DisplayNameVC : BaseVC { @objc private func register() { func showError(title: String, message: String = "") { let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment: ""), style: .default, handler: nil)) presentAlert(alert) } let displayName = displayNameTextField.text!.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines) diff --git a/Session/Onboarding/LinkDeviceVC.swift b/Session/Onboarding/LinkDeviceVC.swift index e346bc325..e2defa126 100644 --- a/Session/Onboarding/LinkDeviceVC.swift +++ b/Session/Onboarding/LinkDeviceVC.swift @@ -124,7 +124,7 @@ final class LinkDeviceVC : BaseVC, UIPageViewControllerDataSource, UIPageViewCon func continueWithSeed(_ seed: Data) { if (seed.count != 16) { let alert = UIAlertController(title: NSLocalizedString("invalid_recovery_phrase", comment: ""), message: NSLocalizedString("Please check the Recovery Phrase and try again.", comment: ""), preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: { _ in + alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment: ""), style: .default, handler: { _ in self.scanQRCodeWrapperVC.startCapture() })) presentAlert(alert) @@ -273,7 +273,7 @@ private final class RecoveryPhraseVC : UIViewController { @objc private func handleContinueButtonTapped() { func showError(title: String, message: String = "") { let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment: ""), style: .default, handler: nil)) presentAlert(alert) } let mnemonic = mnemonicTextView.text!.lowercased() diff --git a/Session/Onboarding/PNModeVC.swift b/Session/Onboarding/PNModeVC.swift index 474b5c975..56f2c9afd 100644 --- a/Session/Onboarding/PNModeVC.swift +++ b/Session/Onboarding/PNModeVC.swift @@ -90,7 +90,7 @@ final class PNModeVC : BaseVC, OptionViewDelegate { guard selectedOptionView != nil else { let title = NSLocalizedString("vc_pn_mode_no_option_picked_modal_title", comment: "") let alert = UIAlertController(title: title, message: nil, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment: ""), style: .default, handler: nil)) return present(alert, animated: true, completion: nil) } UserDefaults.standard[.isUsingFullAPNs] = (selectedOptionView == apnsOptionView) diff --git a/Session/Onboarding/RestoreVC.swift b/Session/Onboarding/RestoreVC.swift index 9e2543c75..ad4dbc4ff 100644 --- a/Session/Onboarding/RestoreVC.swift +++ b/Session/Onboarding/RestoreVC.swift @@ -157,7 +157,7 @@ final class RestoreVC : BaseVC { @objc private func restore() { func showError(title: String, message: String = "") { let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment: ""), style: .default, handler: nil)) presentAlert(alert) } let mnemonic = mnemonicTextView.text!.lowercased() diff --git a/Session/Open Groups/JoinOpenGroupVC.swift b/Session/Open Groups/JoinOpenGroupVC.swift index b1587be54..1036394f4 100644 --- a/Session/Open Groups/JoinOpenGroupVC.swift +++ b/Session/Open Groups/JoinOpenGroupVC.swift @@ -161,7 +161,7 @@ final class JoinOpenGroupVC : BaseVC, UIPageViewControllerDataSource, UIPageView // MARK: Convenience private func showError(title: String, message: String = "") { let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment: ""), style: .default, handler: nil)) presentAlert(alert) } } diff --git a/Session/Settings/NukeDataModal.swift b/Session/Settings/NukeDataModal.swift index 0246c7ae8..7c86d629c 100644 --- a/Session/Settings/NukeDataModal.swift +++ b/Session/Settings/NukeDataModal.swift @@ -146,13 +146,13 @@ final class NukeDataModal : Modal { message = String(format: NSLocalizedString("dialog_clear_all_data_deletion_failed_2", comment: ""), String(potentiallyMaliciousSnodes.count), potentiallyMaliciousSnodes.joined(separator: ", ")) } let alert = UIAlertController(title: "Error", message: message, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment: ""), style: .default, handler: nil)) self?.presentAlert(alert) } }.catch(on: DispatchQueue.main) { error in self?.dismiss(animated: true, completion: nil) // Dismiss the loader let alert = UIAlertController(title: "Error", message: error.localizedDescription, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment: ""), style: .default, handler: nil)) self?.presentAlert(alert) } } diff --git a/Session/Settings/QRCodeVC.swift b/Session/Settings/QRCodeVC.swift index 1658a9f73..158b88927 100644 --- a/Session/Settings/QRCodeVC.swift +++ b/Session/Settings/QRCodeVC.swift @@ -123,7 +123,7 @@ final class QRCodeVC : BaseVC, UIPageViewControllerDataSource, UIPageViewControl fileprivate func startNewPrivateChatIfPossible(with hexEncodedPublicKey: String) { if !ECKeyPair.isValidHexEncodedPublicKey(candidate: hexEncodedPublicKey) { let alert = UIAlertController(title: NSLocalizedString("invalid_session_id", comment: ""), message: NSLocalizedString("Please check the Session ID and try again.", comment: ""), preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment: ""), style: .default, handler: nil)) presentAlert(alert) } else { let thread = TSContactThread.getOrCreateThread(contactSessionID: hexEncodedPublicKey) diff --git a/Session/Settings/SettingsVC.swift b/Session/Settings/SettingsVC.swift index 64046bb71..bb11ac90f 100644 --- a/Session/Settings/SettingsVC.swift +++ b/Session/Settings/SettingsVC.swift @@ -377,7 +377,7 @@ final class SettingsVC : BaseVC, AvatarViewHelperDelegate { let title = isMaxFileSizeExceeded ? "Maximum File Size Exceeded" : "Couldn't Update Profile" let message = isMaxFileSizeExceeded ? "Please select a smaller photo and try again" : "Please check your internet connection and try again" let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment: ""), style: .default, handler: nil)) self?.present(alert, animated: true, completion: nil) } } @@ -443,7 +443,7 @@ final class SettingsVC : BaseVC, AvatarViewHelperDelegate { @objc private func handleSaveDisplayNameButtonTapped() { func showError(title: String, message: String = "") { let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), style: .default, handler: nil)) + alert.addAction(UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment: ""), style: .default, handler: nil)) presentAlert(alert) } let displayName = displayNameTextField.text!.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines) diff --git a/SessionShareExtension/ShareVC.swift b/SessionShareExtension/ShareVC.swift index 749b2f0c7..1492f8d80 100644 --- a/SessionShareExtension/ShareVC.swift +++ b/SessionShareExtension/ShareVC.swift @@ -231,7 +231,7 @@ final class ShareVC : UINavigationController, ShareViewDelegate, AppModeManagerD func shareViewFailed(error: Error) { let alert = UIAlertController(title: "Session", message: error.localizedDescription, preferredStyle: .alert) - alert.addAction(UIAlertAction(title: "OK".localized(), style: .default, handler: { _ in + alert.addAction(UIAlertAction(title: "BUTTON_OK".localized(), style: .default, handler: { _ in self.extensionContext!.cancelRequest(withError: error) })) present(alert, animated: true, completion: nil) diff --git a/SessionShareExtension/ThreadPickerVC.swift b/SessionShareExtension/ThreadPickerVC.swift index 0eef72d5f..6e4df133a 100644 --- a/SessionShareExtension/ThreadPickerVC.swift +++ b/SessionShareExtension/ThreadPickerVC.swift @@ -155,8 +155,16 @@ final class ThreadPickerVC: UIViewController, UITableViewDataSource, UITableView let message = VisibleMessage() message.sentTimestamp = NSDate.millisecondTimestamp() - message.text = messageText - + message.text = (isSharingUrl && (messageText?.isEmpty == true || attachments[0].linkPreviewDraft == nil) ? + ( + (messageText?.isEmpty == true ? + attachments[0].text() : + "\(attachments[0].text() ?? "")\n\n\(messageText ?? "")" + ) + ) : + messageText + ) + let tsMessage = TSOutgoingMessage.from(message, associatedWith: selectedThread!) Storage.write( with: { transaction in diff --git a/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalInputAccessoryView.swift b/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalInputAccessoryView.swift index 4732da2d0..824a9008a 100644 --- a/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalInputAccessoryView.swift +++ b/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalInputAccessoryView.swift @@ -191,6 +191,7 @@ extension AttachmentApprovalInputAccessoryView: AttachmentCaptionToolbarDelegate return } + // TODO: Look at refactoring this behaviour to consolidate attachment mutations currentAttachmentItem.attachment.captionText = attachmentCaptionToolbar.textView.text delegate?.attachmentApprovalInputUpdateMediaRail() diff --git a/SignalUtilitiesKit/Media Viewing & Editing/MediaMessageView.swift b/SignalUtilitiesKit/Media Viewing & Editing/MediaMessageView.swift index 777f4c8ec..6743f556b 100644 --- a/SignalUtilitiesKit/Media Viewing & Editing/MediaMessageView.swift +++ b/SignalUtilitiesKit/Media Viewing & Editing/MediaMessageView.swift @@ -415,6 +415,9 @@ public class MediaMessageView: UIView, OWSAudioPlayerDelegate { } private func setupLayout() { + // Plain text will just be put in the 'message' input so do nothing + guard attachment.fileType != .text && attachment.fileType != .oversizeText else { return } + // Sizing calculations let clampedRatio: CGFloat = { switch attachment.fileType { diff --git a/SignalUtilitiesKit/Messaging/BlockListUIUtils.m b/SignalUtilitiesKit/Messaging/BlockListUIUtils.m index 67bac3464..1c78ee13c 100644 --- a/SignalUtilitiesKit/Messaging/BlockListUIUtils.m +++ b/SignalUtilitiesKit/Messaging/BlockListUIUtils.m @@ -460,7 +460,7 @@ typedef void (^BlockAlertCompletionBlock)(UIAlertAction *action); UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert]; - UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil) + UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"BUTTON_OK", nil) accessibilityIdentifier:ACCESSIBILITY_IDENTIFIER_WITH_NAME(self, @"ok") style:UIAlertActionStyleDefault handler:completionBlock]; diff --git a/SignalUtilitiesKit/Utilities/OWSAlerts.swift b/SignalUtilitiesKit/Utilities/OWSAlerts.swift index db7974a1f..5db9ecf7d 100644 --- a/SignalUtilitiesKit/Utilities/OWSAlerts.swift +++ b/SignalUtilitiesKit/Utilities/OWSAlerts.swift @@ -57,7 +57,7 @@ import Foundation let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) - let actionTitle = buttonTitle ?? NSLocalizedString("OK", comment: "") + let actionTitle = buttonTitle ?? NSLocalizedString("BUTTON_OK", comment: "") let okAction = UIAlertAction(title: actionTitle, style: .default, handler: buttonAction) okAction.accessibilityIdentifier = "OWSAlerts.\("ok")" alert.addAction(okAction) @@ -71,7 +71,7 @@ import Foundation let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) alert.addAction(self.cancelAction) - let actionTitle = proceedTitle ?? NSLocalizedString("OK", comment: "") + let actionTitle = proceedTitle ?? NSLocalizedString("BUTTON_OK", comment: "") let okAction = UIAlertAction(title: actionTitle, style: .default, handler: proceedAction) okAction.accessibilityIdentifier = "OWSAlerts.\("ok")" alert.addAction(okAction)