feat(i18n,mining): translate warmup block/tx-type labels; fix the disconnected-solo mine tooltip
- Warmup/daemon status no longer appends a hardcoded English " (Block N)" — it uses a translated warmup_block_fmt key. - Recent-transaction type labels (Sent/Received/Mined) are now translated in the UI consumer (recentTypeLabel in balance_recent_tx.cpp) with a generic "Transaction" fallback, instead of the data layer's raw English getTypeDisplay(). - Mining: a disconnected solo miner hovering the dead Mine button now gets a "not connected to the node" tooltip instead of a misleading "Start Mining" (the tooltip chain had no branch for the solo !isConnected() disable). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "balance_recent_tx.h"
|
||||
#include "../../config/version.h"
|
||||
#include "../../util/text_format.h"
|
||||
#include "../../util/i18n.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
@@ -23,12 +24,22 @@ std::string recentTimeAgo(int64_t timestamp)
|
||||
{
|
||||
return util::formatTimeAgoShort(timestamp);
|
||||
}
|
||||
|
||||
// Translated type label (the data layer's getTypeDisplay() returns raw English). Never leak a raw RPC
|
||||
// category: anything unrecognized (including "shield") falls back to a generic "Transaction".
|
||||
std::string recentTypeLabel(const std::string& type)
|
||||
{
|
||||
if (type == "send") return TR("sent_type");
|
||||
if (type == "receive") return TR("received_label");
|
||||
if (type == "mined" || type == "generate" || type == "immature") return TR("mined_type");
|
||||
return TR("tx_type_generic");
|
||||
}
|
||||
}
|
||||
|
||||
RecentTxDisplay buildRecentTxDisplay(const TransactionInfo& tx, int addressMaxLen)
|
||||
{
|
||||
return {
|
||||
tx.getTypeDisplay(),
|
||||
recentTypeLabel(tx.type),
|
||||
util::truncateMiddle(tx.address, addressMaxLen),
|
||||
formatRecentAmount(tx.type, tx.amount),
|
||||
recentTimeAgo(tx.timestamp)
|
||||
|
||||
Reference in New Issue
Block a user