Updated the code to use the localised copy for the deprecation UI

pull/894/head
Morgan Pretty 2 months ago
parent 6830c68c31
commit 45a9586318

@ -2735,8 +2735,8 @@ extension ConversationVC {
let closedGroupName: String? = self.viewModel.threadData.closedGroupName let closedGroupName: String? = self.viewModel.threadData.closedGroupName
let confirmationModal: ConfirmationModal = ConfirmationModal( let confirmationModal: ConfirmationModal = ConfirmationModal(
info: ConfirmationModal.Info( info: ConfirmationModal.Info(
title: "Recreate Group",//.localized(), title: "recreateGroup".localized(),
body: .text("Chat history will not be transferred to the new group. You can still view all chat history in your old group."/*.localized()*/), body: .text("legacyGroupChatHistory".localized()),
confirmTitle: "theContinue".localized(), confirmTitle: "theContinue".localized(),
confirmStyle: .danger, confirmStyle: .danger,
cancelStyle: .alert_text cancelStyle: .alert_text

@ -69,10 +69,10 @@ public class ConversationViewModel: OWSAudioPlayerDelegate, NavigatableStateHold
let localizationKey: String let localizationKey: String
switch (dependencies[feature: .legacyGroupsDeprecated], threadData.currentUserIsClosedGroupAdmin == true) { switch (dependencies[feature: .legacyGroupsDeprecated], threadData.currentUserIsClosedGroupAdmin == true) {
case (false, false): localizationKey = "groupLegacyBanner" case (false, false): localizationKey = "legacyGroupBeforeDeprecationMember"
case (false, true): localizationKey = "groupLegacyBanner" case (false, true): localizationKey = "legacyGroupBeforeDeprecationAdmin"
case (true, false): localizationKey = "groupLegacyBanner" case (true, false): localizationKey = "legacyGroupAfterDeprecationMember"
case (true, true): localizationKey = "groupLegacyBanner" case (true, true): localizationKey = "legacyGroupAfterDeprecationAdmin"
} }
// FIXME: Strings should be updated in Crowdin to include the {icon} // FIXME: Strings should be updated in Crowdin to include the {icon}

@ -65,7 +65,9 @@ final class ThreadPickerVC: UIViewController, UITableViewDataSource, UITableView
private lazy var noAccountErrorLabel: UILabel = { private lazy var noAccountErrorLabel: UILabel = {
let result: UILabel = UILabel() let result: UILabel = UILabel()
result.font = .systemFont(ofSize: Values.mediumFontSize) result.font = .systemFont(ofSize: Values.mediumFontSize)
result.text = "Oops! Looks like you don't have a \(Constants.app_name) account yet.\n\nYou'll need to create one in the \(Constants.app_name) app before you can share."//.localized() result.text = "shareExtensionNoAccountError"
.put(key: "app_name", value: Constants.app_name)
.localized()
result.textAlignment = .center result.textAlignment = .center
result.themeTextColor = .textPrimary result.themeTextColor = .textPrimary
result.numberOfLines = 0 result.numberOfLines = 0

@ -898,56 +898,52 @@ public extension Publisher where Failure == Error {
// MARK: - CallInfo // MARK: - CallInfo
private extension Storage { private extension Storage {
// MARK: - CallInfo class CallInfo {
enum Behaviour {
private extension Storage { case syncRead
class CallInfo { case asyncRead
enum Behaviour { case syncWrite
case syncRead case asyncWrite
case asyncRead }
case syncWrite
case asyncWrite weak var storage: Storage?
} let file: String
let function: String
weak var storage: Storage? let line: Int
let file: String let behaviour: Behaviour
let function: String
let line: Int var callInfo: String {
let behaviour: Behaviour let fileInfo: String = (file.components(separatedBy: "/").last.map { "\($0):\(line) - " } ?? "")
var callInfo: String {
let fileInfo: String = (file.components(separatedBy: "/").last.map { "\($0):\(line) - " } ?? "")
return "\(fileInfo)\(function)"
}
var isWrite: Bool { return "\(fileInfo)\(function)"
switch behaviour { }
case .syncWrite, .asyncWrite: return true
case .syncRead, .asyncRead: return false var isWrite: Bool {
} switch behaviour {
} case .syncWrite, .asyncWrite: return true
var isAsync: Bool { case .syncRead, .asyncRead: return false
switch behaviour {
case .asyncRead, .asyncWrite: return true
case .syncRead, .syncWrite: return false
}
} }
}
init( var isAsync: Bool {
_ storage: Storage?, switch behaviour {
_ file: String, case .asyncRead, .asyncWrite: return true
_ function: String, case .syncRead, .syncWrite: return false
_ line: Int,
_ behaviour: Behaviour
) {
self.storage = storage
self.file = file
self.function = function
self.line = line
self.behaviour = behaviour
} }
} }
init(
_ storage: Storage?,
_ file: String,
_ function: String,
_ line: Int,
_ behaviour: Behaviour
) {
self.storage = storage
self.file = file
self.function = function
self.line = line
self.behaviour = behaviour
}
} }
} }

Loading…
Cancel
Save