i18n(chat): translate the chat send/receive toasts into all 8 languages

The HushChat UI labels were already translated, but the send-path
notifications (not-connected, no-z-address, waiting-for-reply, compose
failures, contact-request queued, lite busy) were still hardcoded English.
Route all eight call sites in app_network.cpp through TR() with seven new
keys (the three "no z-address" variants unified into chat_toast_no_zaddr),
add the English fallbacks in i18n.cpp, and translate the keys into de/es/fr/
ja/ko/pt/ru/zh — reusing each file's existing chat_* terminology (z-address,
contact request, message) for consistency. Additive only (950 -> 957 keys
per language). CJK subset font rebuilt to cover the new zh/ja/ko glyphs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-06 23:36:56 -05:00
parent 6ddca6aed0
commit b75801f5c4
11 changed files with 72 additions and 9 deletions

View File

@@ -2543,12 +2543,12 @@ bool App::broadcastChatMemos(const chat::OutgoingChatMemos& memos)
}
if (!state_.connected || !rpc_ || !worker_) {
ui::Notifications::instance().error("Not connected — chat message not sent.");
ui::Notifications::instance().error(TR("chat_toast_not_connected"));
return false;
}
const std::string from = chatReplyZaddr(); // spendable + advertised as the reply-to address
if (from.empty()) {
ui::Notifications::instance().error("No spendable z-address to send chat from.");
ui::Notifications::instance().error(TR("chat_toast_no_zaddr"));
return false;
}
@@ -2588,7 +2588,7 @@ bool App::broadcastChatMemosLite(const chat::OutgoingChatMemos& memos)
req.recipients.push_back(std::move(recipient));
}
if (!lite_wallet_->sendTransaction(req)) {
ui::Notifications::instance().error("A send is already in progress, or no wallet is open.");
ui::Notifications::instance().error(TR("chat_toast_lite_busy"));
return false;
}
return true;
@@ -2607,19 +2607,19 @@ void App::sendChatMessage(const std::string& conversationId, const std::string&
if (!m.peer_public_key_hex.empty()) peerPubKey = m.peer_public_key_hex;
}
if (peerPubKey.empty()) {
ui::Notifications::instance().info("Waiting for the contact to reply before you can message them.");
ui::Notifications::instance().info(TR("chat_toast_waiting_reply"));
return;
}
const std::string myReply = chatReplyZaddr();
if (myReply.empty()) {
ui::Notifications::instance().error("No z-address available to send chat from.");
ui::Notifications::instance().error(TR("chat_toast_no_zaddr"));
return;
}
chat::OutgoingChatMemos memos;
if (chat_service_.composeMessage(myReply, peerPubKey, peerZaddr, conversationId, text, memos)
!= chat::ChatComposeStatus::Ok) {
ui::Notifications::instance().error("Could not compose the message (too long?).");
ui::Notifications::instance().error(TR("chat_toast_compose_failed"));
return;
}
const bool submitted = broadcastChatMemos(memos);
@@ -2644,7 +2644,7 @@ void App::startChatConversation(const std::string& peerZaddr, const std::string&
if (peerZaddr.empty() || text.empty()) return;
const std::string myReply = chatReplyZaddr();
if (myReply.empty()) {
ui::Notifications::instance().error("No z-address available to send chat from.");
ui::Notifications::instance().error(TR("chat_toast_no_zaddr"));
return;
}
@@ -2652,7 +2652,7 @@ void App::startChatConversation(const std::string& peerZaddr, const std::string&
chat::OutgoingChatMemos memos;
if (chat_service_.composeContactRequest(myReply, peerZaddr, cid, text, memos)
!= chat::ChatComposeStatus::Ok) {
ui::Notifications::instance().error("Could not compose the contact request (invalid address / text?).");
ui::Notifications::instance().error(TR("chat_toast_request_compose_failed"));
return;
}
const bool submitted = broadcastChatMemos(memos);
@@ -2668,7 +2668,7 @@ void App::startChatConversation(const std::string& peerZaddr, const std::string&
echo.payload_position = 0;
echo.delivery = submitted ? chat::ChatDelivery::Sent : chat::ChatDelivery::Failed;
chat_service_.recordOutgoing(echo);
if (submitted) ui::Notifications::instance().success("Contact request queued.");
if (submitted) ui::Notifications::instance().success(TR("chat_toast_request_queued"));
}
// HushChat (lite variant): the full-node harvest works off z_viewtransaction, but the lite wallet's