From 3c7ac96b5a62bdffec12bd7c2c5534c241275c06 Mon Sep 17 00:00:00 2001 From: Ryan ZHAO <> Date: Mon, 18 Mar 2024 10:18:53 +1100 Subject: [PATCH] replace NSLocalizedString() wiith .localized, and remove CommonStrings --- Session.xcodeproj/project.pbxproj | 8 +-- .../ConversationVC+Interaction.swift | 6 +- Session/Conversations/ConversationVC.swift | 2 +- .../EmojiPickerCollectionView.swift | 3 +- .../CropScaleImageViewController.swift | 4 +- .../GIFs/GifPickerViewController.swift | 6 +- .../MediaPageViewController.swift | 2 +- .../PhotoCaptureViewController.swift | 13 +--- .../PhotoLibrary.swift | 2 +- .../Translations/en.lproj/Localizable.strings | 8 +++ .../AttachmentApprovalViewController.swift | 2 +- .../AttachmentTextToolbar.swift | 2 +- ...ModalActivityIndicatorViewController.swift | 2 +- .../Utilities/CommonStrings.swift | 59 ------------------- 14 files changed, 28 insertions(+), 91 deletions(-) delete mode 100644 SignalUtilitiesKit/Utilities/CommonStrings.swift diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index f38d96157..0c5b12aac 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -161,9 +161,9 @@ 7BFD1A8A2745C4F000FB91B9 /* Permissions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BFD1A892745C4F000FB91B9 /* Permissions.swift */; }; 7BFD1A8C2747150E00FB91B9 /* TurnServerInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BFD1A8B2747150E00FB91B9 /* TurnServerInfo.swift */; }; 7BFD1A972747689000FB91B9 /* Session-Turn-Server in Resources */ = {isa = PBXBuildFile; fileRef = 7BFD1A962747689000FB91B9 /* Session-Turn-Server */; }; - 943C6D842B86B5F1004ACE64 /* Localization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 943C6D832B86B5F1004ACE64 /* Localization.swift */; }; 9422EE2B2B8C3A97004C740D /* String+Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9422EE2A2B8C3A97004C740D /* String+Utilities.swift */; }; 943C6D822B75E061004ACE64 /* Message+DisappearingMessages.swift in Sources */ = {isa = PBXBuildFile; fileRef = 943C6D812B75E061004ACE64 /* Message+DisappearingMessages.swift */; }; + 943C6D842B86B5F1004ACE64 /* Localization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 943C6D832B86B5F1004ACE64 /* Localization.swift */; }; 9593A1E796C9E6BE2352EA6F /* Pods_GlobalDependencies_FrameworkAndExtensionDependencies_SessionSnodeKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8B0BA5257C58DC6FF797278 /* Pods_GlobalDependencies_FrameworkAndExtensionDependencies_SessionSnodeKit.framework */; }; 99978E3F7A80275823CA9014 /* Pods_GlobalDependencies_FrameworkAndExtensionDependencies_SessionNotificationServiceExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29E827FDF6C1032BB985740C /* Pods_GlobalDependencies_FrameworkAndExtensionDependencies_SessionNotificationServiceExtension.framework */; }; A11CD70D17FA230600A2D1B1 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A11CD70C17FA230600A2D1B1 /* QuartzCore.framework */; }; @@ -381,7 +381,6 @@ C38EF3FB255B6DF7007E1867 /* UIAlertController+OWS.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF3DD255B6DF1007E1867 /* UIAlertController+OWS.swift */; }; C38EF3FF255B6DF7007E1867 /* TappableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF3E1255B6DF3007E1867 /* TappableView.swift */; }; C38EF400255B6DF7007E1867 /* GalleryRailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF3E2255B6DF3007E1867 /* GalleryRailView.swift */; }; - C38EF402255B6DF7007E1867 /* CommonStrings.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF3E4255B6DF4007E1867 /* CommonStrings.swift */; }; C38EF405255B6DF7007E1867 /* OWSButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF3E7255B6DF5007E1867 /* OWSButton.swift */; }; C38EF407255B6DF7007E1867 /* Toast.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF3E9255B6DF6007E1867 /* Toast.swift */; }; C38EF40B255B6DF7007E1867 /* TappableStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C38EF3ED255B6DF6007E1867 /* TappableStackView.swift */; }; @@ -1309,9 +1308,9 @@ 8E946CB54A221018E23599DE /* Pods-GlobalDependencies-FrameworkAndExtensionDependencies-ExtendedDependencies-SessionUtilitiesKit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GlobalDependencies-FrameworkAndExtensionDependencies-ExtendedDependencies-SessionUtilitiesKit.debug.xcconfig"; path = "Target Support Files/Pods-GlobalDependencies-FrameworkAndExtensionDependencies-ExtendedDependencies-SessionUtilitiesKit/Pods-GlobalDependencies-FrameworkAndExtensionDependencies-ExtendedDependencies-SessionUtilitiesKit.debug.xcconfig"; sourceTree = ""; }; 92E8569C96285EE3CDB5960D /* Pods_GlobalDependencies_FrameworkAndExtensionDependencies_ExtendedDependencies_SignalUtilitiesKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GlobalDependencies_FrameworkAndExtensionDependencies_ExtendedDependencies_SignalUtilitiesKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 93359C81CF2660040B7CD106 /* Pods_GlobalDependencies_FrameworkAndExtensionDependencies_ExtendedDependencies_SessionUtilitiesKit_SessionUtilitiesKitTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GlobalDependencies_FrameworkAndExtensionDependencies_ExtendedDependencies_SessionUtilitiesKit_SessionUtilitiesKitTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 943C6D832B86B5F1004ACE64 /* Localization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Localization.swift; sourceTree = ""; }; 9422EE2A2B8C3A97004C740D /* String+Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Utilities.swift"; sourceTree = ""; }; 943C6D812B75E061004ACE64 /* Message+DisappearingMessages.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Message+DisappearingMessages.swift"; sourceTree = ""; }; + 943C6D832B86B5F1004ACE64 /* Localization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Localization.swift; sourceTree = ""; }; A11CD70C17FA230600A2D1B1 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; A163E8AA16F3F6A90094D68B /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; A1C32D4D17A0652C000A904E /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; @@ -1549,7 +1548,6 @@ C38EF3DD255B6DF1007E1867 /* UIAlertController+OWS.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIAlertController+OWS.swift"; path = "SignalUtilitiesKit/Utilities/UIAlertController+OWS.swift"; sourceTree = SOURCE_ROOT; }; C38EF3E1255B6DF3007E1867 /* TappableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TappableView.swift; path = "SignalUtilitiesKit/Shared Views/TappableView.swift"; sourceTree = SOURCE_ROOT; }; C38EF3E2255B6DF3007E1867 /* GalleryRailView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = GalleryRailView.swift; path = "SignalUtilitiesKit/Shared Views/GalleryRailView.swift"; sourceTree = SOURCE_ROOT; }; - C38EF3E4255B6DF4007E1867 /* CommonStrings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CommonStrings.swift; path = SignalUtilitiesKit/Utilities/CommonStrings.swift; sourceTree = SOURCE_ROOT; }; C38EF3E7255B6DF5007E1867 /* OWSButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OWSButton.swift; path = "SignalUtilitiesKit/Shared Views/OWSButton.swift"; sourceTree = SOURCE_ROOT; }; C38EF3E9255B6DF6007E1867 /* Toast.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Toast.swift; path = "SignalUtilitiesKit/Shared Views/Toast.swift"; sourceTree = SOURCE_ROOT; }; C38EF3ED255B6DF6007E1867 /* TappableStackView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TappableStackView.swift; path = "SignalUtilitiesKit/Shared Views/TappableStackView.swift"; sourceTree = SOURCE_ROOT; }; @@ -3450,7 +3448,6 @@ C33FDA6F255A57FA00E217F9 /* ReachabilityManager.swift */, C33FDB4C255A580D00E217F9 /* AppVersion.h */, C33FDA8B255A57FD00E217F9 /* AppVersion.m */, - C38EF3E4255B6DF4007E1867 /* CommonStrings.swift */, C38EF304255B6DBE007E1867 /* ImageCache.swift */, C38EF2F2255B6DBC007E1867 /* Searcher.swift */, C3F0A52F255C80BC007BE2A3 /* NoopNotificationsManager.swift */, @@ -5724,7 +5721,6 @@ C38EF3FB255B6DF7007E1867 /* UIAlertController+OWS.swift in Sources */, C38EF30C255B6DBF007E1867 /* ScreenLock.swift in Sources */, C38EF363255B6DCC007E1867 /* ModalActivityIndicatorViewController.swift in Sources */, - C38EF402255B6DF7007E1867 /* CommonStrings.swift in Sources */, C38EF3C1255B6DE7007E1867 /* ImageEditorBrushViewController.swift in Sources */, C3F0A530255C80BC007BE2A3 /* NoopNotificationsManager.swift in Sources */, C33FDD8D255A582000E217F9 /* OWSSignalAddress.swift in Sources */, diff --git a/Session/Conversations/ConversationVC+Interaction.swift b/Session/Conversations/ConversationVC+Interaction.swift index bdb118c20..0c952712d 100644 --- a/Session/Conversations/ConversationVC+Interaction.swift +++ b/Session/Conversations/ConversationVC+Interaction.swift @@ -379,7 +379,7 @@ extension ConversationVC: return } - let fileName = urlResourceValues.name ?? NSLocalizedString("attachment", comment: "") + let fileName = urlResourceValues.name ?? "attachment".localized() guard let dataSource = DataSourcePath.dataSource(with: url, shouldDeleteOnDeallocation: false) else { DispatchQueue.main.async { [weak self] in let modal: ConfirmationModal = ConfirmationModal( @@ -2328,7 +2328,7 @@ extension ConversationVC: let modal: ConfirmationModal = ConfirmationModal( targetView: self?.view, info: ConfirmationModal.Info( - title: CommonStrings.errorAlertTitle, + title: "error".localized(), body: .text("context_menu_ban_user_error_alert_message".localized()), cancelTitle: "BUTTON_OK".localized(), cancelStyle: .alert_text @@ -2384,7 +2384,7 @@ extension ConversationVC: let modal: ConfirmationModal = ConfirmationModal( targetView: self?.view, info: ConfirmationModal.Info( - title: CommonStrings.errorAlertTitle, + title: "error".localized(), body: .text("context_menu_ban_user_error_alert_message".localized()), cancelTitle: "BUTTON_OK".localized(), cancelStyle: .alert_text diff --git a/Session/Conversations/ConversationVC.swift b/Session/Conversations/ConversationVC.swift index 7edd4a351..6221538dc 100644 --- a/Session/Conversations/ConversationVC.swift +++ b/Session/Conversations/ConversationVC.swift @@ -1634,7 +1634,7 @@ final class ConversationVC: BaseVC, SessionUtilRespondingViewController, Convers let modal: ConfirmationModal = ConfirmationModal( targetView: self?.view, info: ConfirmationModal.Info( - title: CommonStrings.errorAlertTitle, + title: "error".localized(), body: .text("audioUnableToPlay".localized()), cancelTitle: "BUTTON_OK".localized(), cancelStyle: .alert_text diff --git a/Session/Conversations/Emoji Picker/EmojiPickerCollectionView.swift b/Session/Conversations/Emoji Picker/EmojiPickerCollectionView.swift index 0f251c925..68ef85604 100644 --- a/Session/Conversations/Emoji Picker/EmojiPickerCollectionView.swift +++ b/Session/Conversations/Emoji Picker/EmojiPickerCollectionView.swift @@ -137,8 +137,7 @@ class EmojiPickerCollectionView: UICollectionView { func nameForSection(_ section: Int) -> String? { guard section > 0 || !hasRecentEmoji else { - return NSLocalizedString("EMOJI_CATEGORY_RECENTS_NAME", - comment: "The name for the emoji category 'Recents'") + return "EMOJI_CATEGORY_RECENTS_NAME".localized() } guard let category = Emoji.Category.allCases[safe: section - categoryIndexOffset] else { diff --git a/Session/Media Viewing & Editing/CropScaleImageViewController.swift b/Session/Media Viewing & Editing/CropScaleImageViewController.swift index 70d96563d..eedc7ebdd 100644 --- a/Session/Media Viewing & Editing/CropScaleImageViewController.swift +++ b/Session/Media Viewing & Editing/CropScaleImageViewController.swift @@ -450,10 +450,10 @@ import SessionUtilitiesKit result.distribution = .fillEqually result.alignment = .fill - let cancelButton = createButton(title: CommonStrings.cancelButton, action: #selector(cancelPressed)) + let cancelButton = createButton(title: "cancel".localized(), action: #selector(cancelPressed)) result.addArrangedSubview(cancelButton) - let doneButton = createButton(title: CommonStrings.doneButton, action: #selector(donePressed)) + let doneButton = createButton(title: "done".localized(), action: #selector(donePressed)) doneButton.accessibilityLabel = "Done" result.addArrangedSubview(doneButton) diff --git a/Session/Media Viewing & Editing/GIFs/GifPickerViewController.swift b/Session/Media Viewing & Editing/GIFs/GifPickerViewController.swift index 2cc9f5b93..0ebf08c77 100644 --- a/Session/Media Viewing & Editing/GIFs/GifPickerViewController.swift +++ b/Session/Media Viewing & Editing/GIFs/GifPickerViewController.swift @@ -373,8 +373,8 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect info: ConfirmationModal.Info( title: "errorUnknown".localized(), body: .text(error.localizedDescription), - confirmTitle: CommonStrings.retryButton, - cancelTitle: CommonStrings.dismissButton, + confirmTitle: "retry".localized(), + cancelTitle: "dismiss".localized(), cancelStyle: .alert_text, onConfirm: { _ in self?.getFileForCell(cell) @@ -462,7 +462,7 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect let modal: ConfirmationModal = ConfirmationModal( targetView: self.view, info: ConfirmationModal.Info( - title: CommonStrings.errorAlertTitle, + title: "error".localized(), body: .text("searchEnter".localized()), cancelTitle: "BUTTON_OK".localized(), cancelStyle: .alert_text diff --git a/Session/Media Viewing & Editing/MediaPageViewController.swift b/Session/Media Viewing & Editing/MediaPageViewController.swift index 991e55942..96e9c8f2d 100644 --- a/Session/Media Viewing & Editing/MediaPageViewController.swift +++ b/Session/Media Viewing & Editing/MediaPageViewController.swift @@ -903,7 +903,7 @@ class MediaPageViewController: UIPageViewController, UIPageViewControllerDataSou let formattedDate = dateFormatter.string(from: date) portraitHeaderDateLabel.text = formattedDate - let landscapeHeaderFormat = NSLocalizedString("attachmentsMedia", comment: "embeds {{sender name}} and {{sent datetime}}, e.g. 'Sarah on 10/30/18, 3:29'") + let landscapeHeaderFormat = "attachmentsMedia".localized() let landscapeHeaderText = String(format: landscapeHeaderFormat, name, formattedDate) self.title = landscapeHeaderText self.navigationItem.title = landscapeHeaderText diff --git a/Session/Media Viewing & Editing/PhotoCaptureViewController.swift b/Session/Media Viewing & Editing/PhotoCaptureViewController.swift index 02ac41519..7e999a893 100644 --- a/Session/Media Viewing & Editing/PhotoCaptureViewController.swift +++ b/Session/Media Viewing & Editing/PhotoCaptureViewController.swift @@ -21,14 +21,7 @@ enum PhotoCaptureError: Error { extension PhotoCaptureError: LocalizedError { var localizedDescription: String { - switch self { - case .initializationFailed: - return NSLocalizedString("cameraErrorUnavailable", comment: "alert title") - case .captureFailed: - return NSLocalizedString("cameraErrorUnavailable", comment: "alert title") - case .assertionError: - return NSLocalizedString("cameraErrorUnavailable", comment: "alert title, generic error preventing user from capturing a photo") - } + return "cameraErrorUnavailable".localized() } } @@ -333,9 +326,9 @@ class PhotoCaptureViewController: OWSViewController { Logger.error("error: \(error)") let modal: ConfirmationModal = ConfirmationModal( info: ConfirmationModal.Info( - title: CommonStrings.errorAlertTitle, + title: "error".localized(), body: .text(error.localizedDescription), - cancelTitle: CommonStrings.dismissButton, + cancelTitle: "dismiss".localized(), cancelStyle: .alert_text, afterClosed: { [weak self] in self?.dismiss(animated: true) } ) diff --git a/Session/Media Viewing & Editing/PhotoLibrary.swift b/Session/Media Viewing & Editing/PhotoLibrary.swift index 5ba6dba70..7c9dd6b4b 100644 --- a/Session/Media Viewing & Editing/PhotoLibrary.swift +++ b/Session/Media Viewing & Editing/PhotoLibrary.swift @@ -251,7 +251,7 @@ class PhotoCollection { func localizedTitle() -> String { guard let localizedTitle = collection.localizedTitle?.stripped, localizedTitle.count > 0 else { - return NSLocalizedString("attachmentsAlbumUnnamed", comment: "label for system photo collections which have no name.") + return "attachmentsAlbumUnnamed".localized() } return localizedTitle } diff --git a/Session/Meta/Translations/en.lproj/Localizable.strings b/Session/Meta/Translations/en.lproj/Localizable.strings index 4f16a7a0d..bbafba4f7 100644 --- a/Session/Meta/Translations/en.lproj/Localizable.strings +++ b/Session/Meta/Translations/en.lproj/Localizable.strings @@ -745,3 +745,11 @@ "MESSAGE_DELIVERY_FAILED_TITLE" = "Failed to send message"; "delete_message_for_me_and_my_devices" = "Delete from all of my devices"; "context_menu_ban_user_error_alert_message" = "Unable to ban user"; +"EMOJI_CATEGORY_ACTIVITIES_NAME" = "Activities"; +"EMOJI_CATEGORY_ANIMALS_NAME" = "Animals & Nature"; +"EMOJI_CATEGORY_FLAGS_NAME" = "Flags"; +"EMOJI_CATEGORY_FOOD_NAME" = "Food & Drink"; +"EMOJI_CATEGORY_OBJECTS_NAME" = "Objects"; +"EMOJI_CATEGORY_SMILEYSANDPEOPLE_NAME" = "Smileys & People"; +"EMOJI_CATEGORY_SYMBOLS_NAME" = "Symbols"; +"EMOJI_CATEGORY_TRAVEL_NAME" = "Travel & Places"; diff --git a/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalViewController.swift b/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalViewController.swift index e4bd75443..f5bae4832 100644 --- a/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalViewController.swift +++ b/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalViewController.swift @@ -304,7 +304,7 @@ public class AttachmentApprovalViewController: UIPageViewController, UIPageViewC if mode != .sharedNavigation { // Mimic a UIBarButtonItem of type .cancel, but with a shadow. - let cancelButton = OWSButton(title: CommonStrings.cancelButton) { [weak self] in + let cancelButton = OWSButton(title: "cancel".localized()) { [weak self] in self?.cancelPressed() } cancelButton.titleLabel?.font = .systemFont(ofSize: 17.0) diff --git a/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentTextToolbar.swift b/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentTextToolbar.swift index c4281ee54..a0aa08867 100644 --- a/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentTextToolbar.swift +++ b/SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentTextToolbar.swift @@ -62,7 +62,7 @@ class AttachmentTextToolbar: UIView, UITextViewDelegate { textView.accessibilityIdentifier = "Text input box" textView.isAccessibilityElement = true - let sendTitle = NSLocalizedString("send", comment: "Label for 'send' button in the 'attachment approval' dialog.") + let sendTitle = "send".localized() sendButton.setTitle(sendTitle, for: .normal) sendButton.addTarget(self, action: #selector(didTapSend), for: .touchUpInside) diff --git a/SignalUtilitiesKit/Shared View Controllers/ModalActivityIndicatorViewController.swift b/SignalUtilitiesKit/Shared View Controllers/ModalActivityIndicatorViewController.swift index 06ae06236..294596bc8 100644 --- a/SignalUtilitiesKit/Shared View Controllers/ModalActivityIndicatorViewController.swift +++ b/SignalUtilitiesKit/Shared View Controllers/ModalActivityIndicatorViewController.swift @@ -147,7 +147,7 @@ public class ModalActivityIndicatorViewController: OWSViewController { if canCancel { let cancelButton: SessionButton = SessionButton(style: .destructive, size: .large) - cancelButton.setTitle(CommonStrings.cancelButton, for: .normal) + cancelButton.setTitle("cancel".localized(), for: .normal) cancelButton.addTarget(self, action: #selector(cancelPressed), for: .touchUpInside) self.view.addSubview(cancelButton) diff --git a/SignalUtilitiesKit/Utilities/CommonStrings.swift b/SignalUtilitiesKit/Utilities/CommonStrings.swift deleted file mode 100644 index 9401240d5..000000000 --- a/SignalUtilitiesKit/Utilities/CommonStrings.swift +++ /dev/null @@ -1,59 +0,0 @@ -// -// Copyright (c) 2019 Open Whisper Systems. All rights reserved. -// - -import Foundation - -/** - * Strings re-used in multiple places should be added here. - */ - -@objc public class CommonStrings: NSObject { - @objc - static public let dismissButton = NSLocalizedString("dismiss", comment: "Short text to dismiss current modal / actionsheet / screen") - @objc - static public let cancelButton = NSLocalizedString("cancel", comment: "Label for the cancel button in an alert or action sheet.") - @objc - static public let doneButton = NSLocalizedString("done", comment: "Label for generic done button.") - @objc - static public let retryButton = "retry".localized() - @objc - static public let openSettingsButton = NSLocalizedString("sessionSettings", comment: "Button text which opens the settings app") - @objc - static public let errorAlertTitle = NSLocalizedString("error", comment: "") -} - -@objc public class MessageStrings: NSObject { - @objc - static public let replyNotificationAction = NSLocalizedString("reply", comment: "Notification action button title") - - @objc - static public let markAsReadNotificationAction = NSLocalizedString("messageMarkRead", comment: "Notification action button title") - - @objc - static public let sendButton = "send".localized() -} - -@objc -public class NotificationStrings: NSObject { - @objc - static public let incomingMessageBody = NSLocalizedString("messageNewYouveGotA", comment: "notification body") - - @objc - static public let incomingCollapsedMessagesBody = NSLocalizedString("messageNewYouveGotMany", comment: "collapsed notification body for background polling") - - @objc - static public let incomingGroupMessageTitleFormat = NSLocalizedString("notificationsIosGroup", comment: "notification title. Embeds {{author name}} and {{group name}}") - - @objc - static public let failedToSendBody = "messageErrorDelivery".localized() -} - -@objc public class MediaStrings: NSObject { - @objc - static public let allMedia = NSLocalizedString("conversationsSettingsAllMedia", comment: "nav bar button item") - @objc - static public let media = NSLocalizedString("media", comment: "media tab title") - @objc - static public let document = NSLocalizedString("DOCUMENT_TAB_TITLE", comment: "document tab title") -}