fix(console): localize the lite console + drop full-node-only wording

The lite console tab lagged the full-node one on i18n: its toolbar status,
status lines, help, and error/warning strings were hard-coded English or
worded for a full node (a "daemon" the lite wallet doesn't have).

- toolbarStatus()/statusLines(): route through TR() (reusing the existing
  lite_net_* keys where they already map)
- printHelp(): enumerate the 25 pass-through backend verbs for discoverability,
  since the C++ tab intercepts `help` before the backend's own HelpCommand runs
- gate the destructive 'stop' confirmation to the full node (hasRpcReference);
  lite has no node, so it lets 'stop' fall through to the backend instead of
  showing a phantom "shut down the node" warning behind a dead gate
- word the not-connected error per variant (daemon vs "no wallet open")
- TR() the "(no output)" command-result fallback

Adds 7 i18n keys across all 8 languages (additive); rebuilds the CJK subset
for the one new glyph (U+C5D4 for the Korean "backend"). Build + ctest +
source-hygiene green; changes adversarially verified (no logic/i18n defects).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-18 20:10:17 -05:00
parent 0dcc09fc5f
commit 567732206e
12 changed files with 88 additions and 14 deletions

View File

@@ -258,7 +258,7 @@ bool LiteConsoleExecutor::pollResult(std::string& result, bool& isError)
if (!lw) return false;
wallet::LiteConsoleResult res;
if (!lw->takeConsoleResult(res)) return false;
result = res.response.empty() ? std::string("(no output)") : res.response;
result = res.response.empty() ? std::string(TR("console_no_output")) : res.response;
isError = !res.ok;
return true;
}
@@ -286,6 +286,13 @@ void LiteConsoleExecutor::printHelp(const ConsoleAddLineFn& add)
add(TR("console_help_clear"), ConsoleChannel::None);
add(TR("console_help_help"), ConsoleChannel::None);
add(TR("lite_console_help_passthrough"), ConsoleChannel::Info);
// The lite backend's own command verbs (literal command tokens, not RPC methods — mirrors the
// backend's get_commands() registry). Listed for discoverability: the C++ tab intercepts `help`
// before it can reach the backend's own HelpCommand, so its "type help" advice would dead-end.
add(TR("lite_console_backend_commands"), ConsoleChannel::Info);
add(" sync syncstatus balance addresses height info list notes encryptionstatus", ConsoleChannel::None);
add(" send shield new seed import timport export", ConsoleChannel::None);
add(" encrypt decrypt lock unlock rescan save sietch saplingtree coinsupply", ConsoleChannel::None);
}
std::vector<ConsoleStatusLine> LiteConsoleExecutor::statusLines() const
@@ -294,20 +301,20 @@ std::vector<ConsoleStatusLine> LiteConsoleExecutor::statusLines() const
wallet::LiteWalletController* lw = app_->liteWallet();
if (lw && lw->walletOpen()) {
const SyncInfo& sync = app_->state().sync;
char buf[96];
char buf[128];
if (sync.syncing && !sync.isSynced()) {
double vp = sync.verification_progress;
if (vp < 0.0) vp = 0.0; else if (vp > 1.0) vp = 1.0;
std::snprintf(buf, sizeof(buf), "Syncing %.1f%% (block %d / %d)",
vp * 100.0, sync.blocks, sync.headers);
std::snprintf(buf, sizeof(buf), "%s %.1f%% (block %d / %d)",
TR("lite_net_syncing"), vp * 100.0, sync.blocks, sync.headers);
} else {
std::snprintf(buf, sizeof(buf), "Synced (block %d)", sync.blocks);
std::snprintf(buf, sizeof(buf), "%s (block %d)", TR("lite_net_synced"), sync.blocks);
}
out.push_back({std::string(buf), OnSurfaceMedium(), false});
}
const std::string& err = app_->liteOpenError();
if (!err.empty() && (!lw || !lw->walletOpen()))
out.push_back({std::string("Last error: ") + err, Error(), false});
out.push_back({std::string(TR("console_last_error")) + " " + err, Error(), false});
return out;
}
@@ -315,10 +322,10 @@ ConsoleStatusLine LiteConsoleExecutor::toolbarStatus() const
{
ConsoleStatusLine s;
wallet::LiteWalletController* lw = app_->liteWallet();
if (!lw) { s.text = "No backend"; s.color = Error(); return s; }
if (lw->walletOpen()) { s.text = "Connected"; s.color = Success(); }
else if (lw->openInProgress()) { s.text = "Connecting"; s.color = Warning(); s.pulse = true; }
else { s.text = "Disconnected"; s.color = Error(); }
if (!lw) { s.text = TR("console_backend_unavailable"); s.color = Error(); return s; }
if (lw->walletOpen()) { s.text = TR("lite_net_connected"); s.color = Success(); }
else if (lw->openInProgress()) { s.text = TR("lite_net_connecting"); s.color = Warning(); s.pulse = true; }
else { s.text = TR("lite_net_disconnected"); s.color = Error(); }
return s;
}