diff --git a/Adamant/Modules/Chat/ChatLocalization.swift b/Adamant/Modules/Chat/ChatLocalization.swift index 22f7c8281..93835e54b 100644 --- a/Adamant/Modules/Chat/ChatLocalization.swift +++ b/Adamant/Modules/Chat/ChatLocalization.swift @@ -12,6 +12,12 @@ import CommonKit // MARK: - Localization extension String.adamant { enum chat { + static var admNoActiveNodesTitle: String { + String.localized("ApiService.InternalError.NoActiveNodesTitle", comment: "No active ADM blockchain nodes") + } + static var admNoActiveNodes: String { + String.localized("ApiService.InternalError.NoActiveNodes", comment: "No active ADM blockchain nodes") + } static var sendButton: String { String.localized("ChatScene.Send", comment: "Chat: Send message button") } diff --git a/Adamant/Modules/Chat/View/ChatViewController.swift b/Adamant/Modules/Chat/View/ChatViewController.swift index 432abb656..c18674202 100644 --- a/Adamant/Modules/Chat/View/ChatViewController.swift +++ b/Adamant/Modules/Chat/View/ChatViewController.swift @@ -786,7 +786,7 @@ private extension ChatViewController { func checkNodesEnabled() { guard viewModel.hasEnabledNode else { - viewModel.dialog.send(.noEnabledNodesAlert({ [weak self] in + viewModel.dialog.send(.showNodesListAlertAction({ [weak self] in guard let self else { return } let vc = screensFactory.makeNodesList() navigationController?.pushViewController(vc, animated: true) diff --git a/Adamant/Modules/Chat/View/Managers/ChatDialogManager.swift b/Adamant/Modules/Chat/View/Managers/ChatDialogManager.swift index fc936a5a1..60feffc57 100644 --- a/Adamant/Modules/Chat/View/Managers/ChatDialogManager.swift +++ b/Adamant/Modules/Chat/View/Managers/ChatDialogManager.swift @@ -72,8 +72,8 @@ private extension ChatDialogManager { showMenu(sender: sender) case .freeTokenAlert: showFreeTokenAlert() - case .noEnabledNodesAlert(let showAction): - showNoEnabledNodesAlert(showAction: showAction) + case .showNodesListAlertAction(let showAction): + showNodeListAlert(showAction: showAction) case let .removeMessageAlert(id): showRemoveMessageAlert(id: id) case let .reportMessageAlert(id): @@ -201,10 +201,10 @@ private extension ChatDialogManager { dialogService.present(alert, animated: true, completion: nil) } - func showNoEnabledNodesAlert(showAction: @escaping ()->Void) { + func showNodeListAlert(showAction: @escaping () -> Void) { let alert = UIAlertController( - title: String.adamant.sharedErrors.admNoActiveNodesTitle, - message: String.adamant.sharedErrors.admNoActiveNodes, + title: String.adamant.chat.admNoActiveNodesTitle, + message: String.adamant.chat.admNoActiveNodes, preferredStyleSafe: .alert, source: nil ) diff --git a/Adamant/Modules/Chat/ViewModel/Models/ChatDialog.swift b/Adamant/Modules/Chat/ViewModel/Models/ChatDialog.swift index d29fb4c85..911b01bd5 100644 --- a/Adamant/Modules/Chat/ViewModel/Models/ChatDialog.swift +++ b/Adamant/Modules/Chat/ViewModel/Models/ChatDialog.swift @@ -17,7 +17,7 @@ enum ChatDialog { case warning(String) case richError(Error) case freeTokenAlert - case noEnabledNodesAlert(()->Void) + case showNodesListAlertAction(() -> Void) case removeMessageAlert(id: String) case reportMessageAlert(id: String) case menu(sender: UIBarButtonItem) diff --git a/CommonKit/Sources/CommonKit/Assets/Localization/de.lproj/Localizable.strings b/CommonKit/Sources/CommonKit/Assets/Localization/de.lproj/Localizable.strings index 6ed69a98d..0e5f08518 100644 --- a/CommonKit/Sources/CommonKit/Assets/Localization/de.lproj/Localizable.strings +++ b/CommonKit/Sources/CommonKit/Assets/Localization/de.lproj/Localizable.strings @@ -992,6 +992,9 @@ /* Shared alert 'Send tokens' */ "Shared.SendTokens" = "💸 Tokens senden"; +/* Shared alert 'Review Node List' button. Used on Chat screen. */ +"Shared.ReviewNodeList" = "Review ADM node list"; + /* Shared alert 'Upload file' */ "Shared.UploadFile" = "📄 Datei hochladen"; diff --git a/CommonKit/Sources/CommonKit/Assets/Localization/zh.lproj/Localizable.strings b/CommonKit/Sources/CommonKit/Assets/Localization/zh.lproj/Localizable.strings index ec85602a0..7d4a44b56 100644 --- a/CommonKit/Sources/CommonKit/Assets/Localization/zh.lproj/Localizable.strings +++ b/CommonKit/Sources/CommonKit/Assets/Localization/zh.lproj/Localizable.strings @@ -994,6 +994,9 @@ /* ShareQR scene: User had not authorized access to write images to photolibrary */ "ShareQR.photolibraryNotAuthorized" = "您需要授权ADAMANT才能使用您的照片库"; +/* Shared alert 'Review Node List' button. Used on Chat screen. */ +"Shared.ReviewNodeList" = "Review ADM node list"; + /* Main tab bar: Account page */ "Tabs.Account" = "帐户"; diff --git a/CommonKit/Sources/CommonKit/Localization/AdamantLocalized.swift b/CommonKit/Sources/CommonKit/Localization/AdamantLocalized.swift index c933d2c22..bd4768254 100644 --- a/CommonKit/Sources/CommonKit/Localization/AdamantLocalized.swift +++ b/CommonKit/Sources/CommonKit/Localization/AdamantLocalized.swift @@ -88,14 +88,6 @@ public extension String.adamant { String.localizedStringWithFormat(.localized("ApiService.InternalError.NoAdmNodesAvailable", comment: "No active ADM nodes to fetch the partner's %@ address"), coin) } - public static var admNoActiveNodesTitle: String { - String.localized("ApiService.InternalError.NoActiveNodesTitle", comment: "No active ADM blockchain nodes") - } - - public static var admNoActiveNodes: String { - String.localized("ApiService.InternalError.NoActiveNodes", comment: "No active ADM blockchain nodes") - } - public static var notEnoughMoney: String { String.localized("WalletServices.SharedErrors.notEnoughMoney", comment: "Wallet Services: Shared error, user do not have enought money.") }