From b4789ebc9e24b0ea4a6aee2d70779c271e16ea38 Mon Sep 17 00:00:00 2001 From: woodser <13068859+woodser@users.noreply.github.com> Date: Thu, 21 Aug 2025 10:04:38 -0400 Subject: [PATCH] format message on error connecting to monero network --- .../java/haveno/core/api/XmrConnectionService.java | 10 +++++++++- core/src/main/resources/i18n/displayStrings.properties | 1 + .../main/resources/i18n/displayStrings_cs.properties | 1 + .../main/resources/i18n/displayStrings_de.properties | 1 + .../main/resources/i18n/displayStrings_es.properties | 1 + .../main/resources/i18n/displayStrings_fa.properties | 1 + .../main/resources/i18n/displayStrings_fr.properties | 1 + .../main/resources/i18n/displayStrings_it.properties | 1 + .../main/resources/i18n/displayStrings_ja.properties | 1 + .../resources/i18n/displayStrings_pt-br.properties | 1 + .../main/resources/i18n/displayStrings_pt.properties | 1 + .../main/resources/i18n/displayStrings_ru.properties | 1 + .../main/resources/i18n/displayStrings_th.properties | 1 + .../main/resources/i18n/displayStrings_tr.properties | 1 + .../resources/i18n/displayStrings_zh-hans.properties | 1 + .../resources/i18n/displayStrings_zh-hant.properties | 1 + 16 files changed, 24 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/haveno/core/api/XmrConnectionService.java b/core/src/main/java/haveno/core/api/XmrConnectionService.java index 16565a83b6..a11bbbd2bb 100644 --- a/core/src/main/java/haveno/core/api/XmrConnectionService.java +++ b/core/src/main/java/haveno/core/api/XmrConnectionService.java @@ -24,6 +24,7 @@ import haveno.common.UserThread; import haveno.common.app.DevEnv; import haveno.common.config.BaseCurrencyNetwork; import haveno.common.config.Config; +import haveno.core.locale.Res; import haveno.core.trade.HavenoUtils; import haveno.core.user.Preferences; import haveno.core.xmr.model.EncryptedConnectionList; @@ -915,8 +916,15 @@ public final class XmrConnectionService { // skip if shut down if (isShutDownStarted) return; + // format error message + String errorMsg = e.getMessage(); + if (errorMsg != null && errorMsg.contains(": ")) { + errorMsg = errorMsg.substring(errorMsg.indexOf(": ") + 2); // strip exception class + } + errorMsg = Res.get("popup.warning.moneroConnection", errorMsg); + // set error message - getConnectionServiceErrorMsg().set(e.getMessage()); + getConnectionServiceErrorMsg().set(errorMsg); } finally { pollInProgress = false; } diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 7f196e2be5..ed67e5d14c 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -2194,6 +2194,7 @@ popup.warning.lockedUpFunds=You have locked up funds from a failed trade.\n\ Deposit tx address: {1}\n\ Trade ID: {2}.\n\n\ Please open a support ticket by selecting the trade in the open trades screen and pressing \"alt + o\" or \"option + o\"." +popup.warning.moneroConnection=There was a problem connecting to the Monero network.\n\n{0} popup.warning.makerTxInvalid=This offer is not valid. Please choose a different offer.\n\n takeOffer.cancelButton=Cancel take-offer diff --git a/core/src/main/resources/i18n/displayStrings_cs.properties b/core/src/main/resources/i18n/displayStrings_cs.properties index 2464511c9b..149f3fa657 100644 --- a/core/src/main/resources/i18n/displayStrings_cs.properties +++ b/core/src/main/resources/i18n/displayStrings_cs.properties @@ -2145,6 +2145,7 @@ popup.warning.lockedUpFunds=Zamkli jste finanční prostředky z neúspěšného Adresa vkladové tx: {1}\n\ ID obchodu: {2}.\n\n\ Otevřete prosím úkol pro podporu výběrem obchodu na obrazovce otevřených obchodů a stisknutím \"alt + o\" nebo \"option + o\"." +popup.warning.moneroConnection=Došlo k problému s připojením k síti Monero.\n\n{0} popup.warning.makerTxInvalid=Tato nabídka není platná. Prosím vyberte jinou nabídku.\n\n takeOffer.cancelButton=Zrušit akceptaci nabídky diff --git a/core/src/main/resources/i18n/displayStrings_de.properties b/core/src/main/resources/i18n/displayStrings_de.properties index cc404fce68..d1c4c0ce74 100644 --- a/core/src/main/resources/i18n/displayStrings_de.properties +++ b/core/src/main/resources/i18n/displayStrings_de.properties @@ -1624,6 +1624,7 @@ popup.warning.noPriceFeedAvailable=Es ist kein Marktpreis für diese Währung ve popup.warning.sendMsgFailed=Das Senden der Nachricht an Ihren Handelspartner ist fehlgeschlagen.\nVersuchen Sie es bitte erneut und falls es weiter fehlschlägt, erstellen Sie bitte einen Fehlerbericht. popup.warning.messageTooLong=Ihre Nachricht überschreitet die maximal erlaubte Größe. Sende Sie diese in mehreren Teilen oder laden Sie sie in einen Dienst wie https://pastebin.com hoch. popup.warning.lockedUpFunds=Sie haben gesperrtes Guthaben aus einem gescheiterten Trade.\nGesperrtes Guthaben: {0} \nEinzahlungs-Tx-Adresse: {1}\nTrade ID: {2}.\n\nBitte öffnen Sie ein Support-Ticket, indem Sie den Trade im Bildschirm "Offene Trades" auswählen und auf \"alt + o\" oder \"option + o\" drücken. +popup.warning.moneroConnection=Es gab ein Problem bei der Verbindung zum Monero-Netzwerk.\n\n{0} popup.warning.makerTxInvalid=This offer is not valid. Please choose a different offer.\n\n takeOffer.cancelButton=Cancel take-offer diff --git a/core/src/main/resources/i18n/displayStrings_es.properties b/core/src/main/resources/i18n/displayStrings_es.properties index 55f2524247..cd1b02486a 100644 --- a/core/src/main/resources/i18n/displayStrings_es.properties +++ b/core/src/main/resources/i18n/displayStrings_es.properties @@ -1625,6 +1625,7 @@ popup.warning.noPriceFeedAvailable=No hay una fuente de precios disponible para popup.warning.sendMsgFailed=El envío de mensaje a su compañero de intercambio falló.\nPor favor, pruebe de nuevo y si continúa fallando, reporte el fallo. popup.warning.messageTooLong=Su mensaje excede el tamaño máximo permitido. Por favor, envíelo por partes o súbalo a un servicio como https://pastebin.com popup.warning.lockedUpFunds=Ha bloqueado fondos de un intercambio fallido.\nBalance bloqueado: {0}\nDirección de depósito TX: {1}\nID de intercambio: {2}.\n\nPor favor, abra un ticket de soporte seleccionando el intercambio en la pantalla de intercambios pendientes y haciendo clic en \"alt + o\" o \"option + o\"." +popup.warning.moneroConnection=Hubo un problema al conectar con la red de Monero.\n\n{0} popup.warning.makerTxInvalid=Esta oferta no es válida. Por favor seleccione otra oferta diferente.\n\n takeOffer.cancelButton=Cancelar toma de oferta diff --git a/core/src/main/resources/i18n/displayStrings_fa.properties b/core/src/main/resources/i18n/displayStrings_fa.properties index 197b026a57..0247d66e17 100644 --- a/core/src/main/resources/i18n/displayStrings_fa.properties +++ b/core/src/main/resources/i18n/displayStrings_fa.properties @@ -1620,6 +1620,7 @@ popup.warning.noPriceFeedAvailable=برای این ارز هیچ خوراک قی popup.warning.sendMsgFailed=ارسال پیام به شریک معاملاتی شما ناموفق بود. \nلطفا دوباره امتحان کنید و اگر همچنان ناموفق بود، گزارش یک اشکال را ارسال کنید. popup.warning.messageTooLong=پیام شما بیش از حداکثر اندازه مجاز است. لطفا آن را در چند بخش ارسال کنید یا آن را در یک سرویس مانند https://pastebin.com آپلود کنید. popup.warning.lockedUpFunds=You have locked up funds from a failed trade.\nLocked up balance: {0} \nDeposit tx address: {1}\nTrade ID: {2}.\n\nPlease open a support ticket by selecting the trade in the open trades screen and pressing \"alt + o\" or \"option + o\"." +popup.warning.moneroConnection=مشکلی در اتصال به شبکه مونرو رخ داده است.\n\n{0} popup.warning.makerTxInvalid=This offer is not valid. Please choose a different offer.\n\n takeOffer.cancelButton=Cancel take-offer diff --git a/core/src/main/resources/i18n/displayStrings_fr.properties b/core/src/main/resources/i18n/displayStrings_fr.properties index fa39f97b4e..f427dd0a96 100644 --- a/core/src/main/resources/i18n/displayStrings_fr.properties +++ b/core/src/main/resources/i18n/displayStrings_fr.properties @@ -1626,6 +1626,7 @@ popup.warning.noPriceFeedAvailable=Il n'y a pas de flux pour le prix de disponib popup.warning.sendMsgFailed=L'envoi du message à votre partenaire d'échange a échoué.\nMerci d'essayer de nouveau et si l'échec persiste merci de reporter le bug. popup.warning.messageTooLong=Votre message dépasse la taille maximale autorisée. Veuillez l'envoyer en plusieurs parties ou le télécharger depuis un service comme https://pastebin.com. popup.warning.lockedUpFunds=Vous avez des fonds bloqués d'une transaction qui a échoué.\nSolde bloqué: {0}\nAdresse de la tx de dépôt: {1}\nID de l'échange: {2}.\n\nVeuillez ouvrir un ticket de support en sélectionnant la transaction dans l'écran des transactions ouvertes et en appuyant sur \"alt + o\" ou \"option + o\". +popup.warning.moneroConnection=Il y a eu un problème de connexion au réseau Monero.\n\n{0} popup.warning.makerTxInvalid=Cette offre n'est pas valide. Veuillez choisir une autre offre.\n\n takeOffer.cancelButton=Annuler la prise de l'offre diff --git a/core/src/main/resources/i18n/displayStrings_it.properties b/core/src/main/resources/i18n/displayStrings_it.properties index a38b60d8aa..2ad8db100a 100644 --- a/core/src/main/resources/i18n/displayStrings_it.properties +++ b/core/src/main/resources/i18n/displayStrings_it.properties @@ -1623,6 +1623,7 @@ popup.warning.noPriceFeedAvailable=Non è disponibile alcun feed di prezzi per l popup.warning.sendMsgFailed=Invio del messaggio al tuo partner commerciale non riuscito.\nTi preghiamo di riprovare e se continua a fallire segnalare un bug. popup.warning.messageTooLong=Il tuo messaggio supera la dimensione massima consentita. Si prega di inviarlo in più parti o caricarlo su un servizio come https://pastebin.com. popup.warning.lockedUpFunds=Hai bloccato i fondi da uno scambio fallito.\nSaldo bloccato: {0}\nIndirizzo tx deposito: {1}\nID scambio: {2}.\n\nApri un ticket di supporto selezionando lo scambio nella schermata degli scambi aperti e premendo \"alt + o\" o \"option + o\"." +popup.warning.moneroConnection=Si è verificato un problema durante la connessione alla rete Monero.\n\n{0} popup.warning.makerTxInvalid=This offer is not valid. Please choose a different offer.\n\n takeOffer.cancelButton=Cancel take-offer diff --git a/core/src/main/resources/i18n/displayStrings_ja.properties b/core/src/main/resources/i18n/displayStrings_ja.properties index 8f771dfbca..92298f055f 100644 --- a/core/src/main/resources/i18n/displayStrings_ja.properties +++ b/core/src/main/resources/i18n/displayStrings_ja.properties @@ -1624,6 +1624,7 @@ popup.warning.noPriceFeedAvailable=その通貨で利用できる価格フィー popup.warning.sendMsgFailed=トレード相手へのメッセージの送信に失敗しました。\nもう一度試してください。失敗し続ける場合はバグを報告してください。 popup.warning.messageTooLong=メッセージが許容サイズ上限を超えています。いくつかに分けて送信するか、 https://pastebin.com のようなサービスにアップロードしてください。 popup.warning.lockedUpFunds=失敗したトレードから残高をロックしました。\nロックされた残高: {0} \nデポジットtxアドレス: {1} \nトレードID: {2}。\n\nオープントレード画面でこのトレードを選択し、「alt + o」または「option + o」を押してサポートチケットを開いてください。 +popup.warning.moneroConnection=Moneroネットワークへの接続中に問題が発生しました。\n\n{0} popup.warning.makerTxInvalid=This offer is not valid. Please choose a different offer.\n\n takeOffer.cancelButton=Cancel take-offer diff --git a/core/src/main/resources/i18n/displayStrings_pt-br.properties b/core/src/main/resources/i18n/displayStrings_pt-br.properties index 2aa2145282..c5938abd30 100644 --- a/core/src/main/resources/i18n/displayStrings_pt-br.properties +++ b/core/src/main/resources/i18n/displayStrings_pt-br.properties @@ -1630,6 +1630,7 @@ popup.warning.btcChangeBelowDustException=Esta transação cria um troco menor d popup.warning.messageTooLong=Sua mensagem excede o tamanho máximo permitido. Favor enviá-la em várias partes ou utilizando um serviço como https://pastebin.com. popup.warning.lockedUpFunds=Você possui fundos travados em uma negociação com erro.\nSaldo travado: {0}\nEndereço da transação de depósito: {1}\nID da negociação: {2}.\n\nPor favor, abra um ticket de suporte selecionando a negociação na tela de negociações em aberto e depois pressionando "\alt+o\" ou \"option+o\". +popup.warning.moneroConnection=Houve um problema ao conectar-se à rede Monero.\n\n{0} popup.warning.makerTxInvalid=This offer is not valid. Please choose a different offer.\n\n takeOffer.cancelButton=Cancel take-offer diff --git a/core/src/main/resources/i18n/displayStrings_pt.properties b/core/src/main/resources/i18n/displayStrings_pt.properties index 4a18a9970c..f31fc5b0e9 100644 --- a/core/src/main/resources/i18n/displayStrings_pt.properties +++ b/core/src/main/resources/i18n/displayStrings_pt.properties @@ -1620,6 +1620,7 @@ popup.warning.noPriceFeedAvailable=Não há feed de preço disponível para essa popup.warning.sendMsgFailed=Enviar mensagem para seu par de negociação falhou.\nPor favor, tente novamente e se continuar a falhar relate um erro. popup.warning.messageTooLong=Sua mensagem excede o tamanho máx. permitido. Por favor enviá-la em várias partes ou carregá-la utilizando um serviço como https://pastebin.com. popup.warning.lockedUpFunds=Você trancou fundos de um negócio falhado..\nSaldo trancado: {0} \nEndereço da tx de Depósito: {1}\nID de negócio: {2}.\n\nPor favor abra um bilhete de apoio selecionando o negócio no ecrã de negócios abertos e pressione \"alt + o\" ou \"option + o\"." +popup.warning.moneroConnection=Houve um problema ao conectar-se à rede Monero.\n\n{0} popup.warning.makerTxInvalid=This offer is not valid. Please choose a different offer.\n\n takeOffer.cancelButton=Cancel take-offer diff --git a/core/src/main/resources/i18n/displayStrings_ru.properties b/core/src/main/resources/i18n/displayStrings_ru.properties index 20ed0a1306..b36ccfe3aa 100644 --- a/core/src/main/resources/i18n/displayStrings_ru.properties +++ b/core/src/main/resources/i18n/displayStrings_ru.properties @@ -1621,6 +1621,7 @@ popup.warning.noPriceFeedAvailable=Источник рыночного курс popup.warning.sendMsgFailed=Не удалось отправить сообщение вашему контрагенту .\nПопробуйте еще раз, и если неисправность повторится, сообщите о ней. popup.warning.messageTooLong=Ваше сообщение превышает макс. разрешённый размер. Разбейте его на несколько частей или загрузите в веб-приложение для работы с отрывками текста, например https://pastebin.com. popup.warning.lockedUpFunds=You have locked up funds from a failed trade.\nLocked up balance: {0} \nDeposit tx address: {1}\nTrade ID: {2}.\n\nPlease open a support ticket by selecting the trade in the open trades screen and pressing \"alt + o\" or \"option + o\"." +popup.warning.moneroConnection=Возникла проблема с подключением к сети Monero.\n\n{0} popup.warning.makerTxInvalid=This offer is not valid. Please choose a different offer.\n\n takeOffer.cancelButton=Cancel take-offer diff --git a/core/src/main/resources/i18n/displayStrings_th.properties b/core/src/main/resources/i18n/displayStrings_th.properties index e023e7f42f..eda88327dc 100644 --- a/core/src/main/resources/i18n/displayStrings_th.properties +++ b/core/src/main/resources/i18n/displayStrings_th.properties @@ -1621,6 +1621,7 @@ popup.warning.noPriceFeedAvailable=ไม่มีฟีดราคาสำห popup.warning.sendMsgFailed=การส่งข้อความไปยังคู่ค้าของคุณล้มเหลว\nโปรดลองอีกครั้งและหากยังคงเกิดขึ้นขึ้นเนื่อง โปรดรายงานข้อผิดพลาดต่อไป popup.warning.messageTooLong=ข้อความของคุณเกินขีดจำกัดสูงสุดที่อนุญาต โปรดแบ่งส่งเป็นหลายส่วนหรืออัปโหลดไปยังบริการเช่น https://pastebin.com popup.warning.lockedUpFunds=You have locked up funds from a failed trade.\nLocked up balance: {0} \nDeposit tx address: {1}\nTrade ID: {2}.\n\nPlease open a support ticket by selecting the trade in the open trades screen and pressing \"alt + o\" or \"option + o\"." +popup.warning.moneroConnection=เกิดปัญหาในการเชื่อมต่อกับเครือข่าย Monero\n\n{0} popup.warning.makerTxInvalid=This offer is not valid. Please choose a different offer.\n\n takeOffer.cancelButton=Cancel take-offer diff --git a/core/src/main/resources/i18n/displayStrings_tr.properties b/core/src/main/resources/i18n/displayStrings_tr.properties index b11a23b90c..603fc228a4 100644 --- a/core/src/main/resources/i18n/displayStrings_tr.properties +++ b/core/src/main/resources/i18n/displayStrings_tr.properties @@ -2137,6 +2137,7 @@ popup.warning.lockedUpFunds=Başarısız bir ticaretten kilitli fonlarınız var Yatırma tx adresi: {1}\n\ Ticaret ID'si: {2}.\n\n\ Lütfen açık ticaretler ekranında ticareti seçerek ve \"alt + o\" veya \"option + o\" tuşlarına basarak bir destek bileti açın. +popup.warning.moneroConnection=Monero ağına bağlanırken bir sorun oluştu.\n\n{0} popup.warning.makerTxInvalid=Bu teklif geçerli değil. Lütfen farklı bir teklif seçin.\n\n takeOffer.cancelButton=Teklifi iptal et diff --git a/core/src/main/resources/i18n/displayStrings_zh-hans.properties b/core/src/main/resources/i18n/displayStrings_zh-hans.properties index 5ad87e6ed0..ad12b8e956 100644 --- a/core/src/main/resources/i18n/displayStrings_zh-hans.properties +++ b/core/src/main/resources/i18n/displayStrings_zh-hans.properties @@ -1628,6 +1628,7 @@ popup.warning.btcChangeBelowDustException=该交易创建的更改输出低于 popup.warning.messageTooLong=您的信息超过最大允许的大小。请将其分成多个部分发送,或将其上传到 https://pastebin.com 之类的服务器。 popup.warning.lockedUpFunds=你已经从一个失败的交易中冻结了资金。\n冻结余额:{0}\n存款tx地址:{1}\n交易单号:{2}\n\n请通过选择待处理交易界面中的交易并点击“alt + o”或“option+ o”打开帮助话题。 +popup.warning.moneroConnection=连接 Monero 网络时出现问题。\n\n{0} popup.warning.makerTxInvalid=This offer is not valid. Please choose a different offer.\n\n takeOffer.cancelButton=Cancel take-offer diff --git a/core/src/main/resources/i18n/displayStrings_zh-hant.properties b/core/src/main/resources/i18n/displayStrings_zh-hant.properties index 93ede394bc..7e95905ba8 100644 --- a/core/src/main/resources/i18n/displayStrings_zh-hant.properties +++ b/core/src/main/resources/i18n/displayStrings_zh-hant.properties @@ -1624,6 +1624,7 @@ popup.warning.noPriceFeedAvailable=該貨幣沒有可用的價格。 你不能 popup.warning.sendMsgFailed=向您的交易對象發送消息失敗。\n請重試,如果繼續失敗報吿錯誤。 popup.warning.messageTooLong=您的信息超過最大允許的大小。請將其分成多個部分發送,或將其上傳到 https://pastebin.com 之類的服務器。 popup.warning.lockedUpFunds=你已經從一個失敗的交易中凍結了資金。\n凍結餘額:{0}\n存款tx地址:{1}\n交易單號:{2}\n\n請通過選擇待處理交易界面中的交易並點擊“alt + o”或“option+ o”打開幫助話題。 +popup.warning.moneroConnection=連接到 Monero 網路時發生問題。\n\n{0} popup.warning.makerTxInvalid=This offer is not valid. Please choose a different offer.\n\n takeOffer.cancelButton=Cancel take-offer