From efc08a2d5a3487a0ce610038f9d309fec288de49 Mon Sep 17 00:00:00 2001 From: Ryan ZHAO <> Date: Thu, 15 Aug 2024 17:09:11 +1000 Subject: [PATCH] fix a couple of string issues. --- .../Conversations/ConversationVC+Interaction.swift | 12 +++--------- Session/Home/HomeVC.swift | 4 +++- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Session/Conversations/ConversationVC+Interaction.swift b/Session/Conversations/ConversationVC+Interaction.swift index 36f325963..cfc274b32 100644 --- a/Session/Conversations/ConversationVC+Interaction.swift +++ b/Session/Conversations/ConversationVC+Interaction.swift @@ -935,19 +935,13 @@ extension ConversationVC: // If it's an incoming media message and the thread isn't trusted then show the placeholder view if cellViewModel.cellType != .textOnlyMessage && cellViewModel.variant == .standardIncoming && !cellViewModel.threadIsTrusted { - let message: String = "attachmentsAutoDownloadModalDescription" + let message: NSAttributedString = "attachmentsAutoDownloadModalDescription" .put(key: "conversation_name", value: cellViewModel.authorName) - .localized() + .localizedFormatted(baseFont: .systemFont(ofSize: Values.smallFontSize)) let confirmationModal: ConfirmationModal = ConfirmationModal( info: ConfirmationModal.Info( title: "attachmentsAutoDownloadModalTitle".localized(), - body: .attributedText( - NSAttributedString(string: message) - .adding( - attributes: [ .font: UIFont.boldSystemFont(ofSize: Values.smallFontSize) ], - range: (message as NSString).range(of: cellViewModel.authorName) - ) - ), + body: .attributedText(message), confirmTitle: "download".localized(), confirmAccessibility: Accessibility(identifier: "Download media"), cancelAccessibility: Accessibility(identifier: "Don't download media"), diff --git a/Session/Home/HomeVC.swift b/Session/Home/HomeVC.swift index ba41a78fa..57cc8c2de 100644 --- a/Session/Home/HomeVC.swift +++ b/Session/Home/HomeVC.swift @@ -247,7 +247,9 @@ final class HomeVC: BaseVC, LibSessionRespondingViewController, UITableViewDataS let welcomeLabel = UILabel() welcomeLabel.font = .systemFont(ofSize: Values.smallFontSize) - welcomeLabel.text = "onboardingBubbleWelcomeToSession".localized() + welcomeLabel.text = "onboardingBubbleWelcomeToSession" + .put(key: "app_name", value: Singleton.appName) + .localized() welcomeLabel.themeTextColor = .sessionButton_text welcomeLabel.textAlignment = .center