fix: sidebar nav text overflow for long translations
- Add text scaling for section labels (TOOLS, ADVANCED) in sidebar - Separate explorer_section key from explorer nav label to fix ALL CAPS - Shorten long sidebar translations: es/pt settings, pt overview, ru tools/advanced - Fix explorer translations from ALL CAPS to proper case in all languages
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
#include "default_banlist_embedded.h"
|
||||
#include "util/platform.h"
|
||||
#include "util/perf_log.h"
|
||||
#include "util/i18n.h"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <curl/curl.h>
|
||||
@@ -95,7 +96,7 @@ void App::tryConnect()
|
||||
++connect_attempt;
|
||||
|
||||
connection_in_progress_ = true;
|
||||
connection_status_ = "Loading configuration...";
|
||||
connection_status_ = TR("sb_loading_config");
|
||||
|
||||
// Auto-detect configuration (file I/O — fast, safe on main thread)
|
||||
auto config = rpc::Connection::autoDetectConfig();
|
||||
@@ -109,23 +110,23 @@ void App::tryConnect()
|
||||
// If we already know an external daemon is on the port, just wait
|
||||
// for the config file to appear (the daemon creates it on first run).
|
||||
if (embedded_daemon_ && embedded_daemon_->externalDaemonDetected()) {
|
||||
connection_status_ = "Waiting for daemon config...";
|
||||
connection_status_ = TR("sb_waiting_config");
|
||||
VERBOSE_LOGF("[connect #%d] External daemon detected on port, waiting for config file to appear\n", connect_attempt);
|
||||
core_timer_ = CORE_INTERVAL_DEFAULT - 1.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
connection_status_ = "No DRAGONX.conf found";
|
||||
connection_status_ = TR("sb_no_conf");
|
||||
|
||||
// Try to start embedded daemon if enabled
|
||||
if (use_embedded_daemon_ && !isEmbeddedDaemonRunning()) {
|
||||
connection_status_ = "Starting dragonxd...";
|
||||
connection_status_ = TR("sb_starting_daemon");
|
||||
if (startEmbeddedDaemon()) {
|
||||
// Will retry connection after daemon starts
|
||||
VERBOSE_LOGF("[connect #%d] Embedded daemon starting, will retry connection...\n", connect_attempt);
|
||||
core_timer_ = CORE_INTERVAL_DEFAULT - 1.0f;
|
||||
} else if (embedded_daemon_ && embedded_daemon_->externalDaemonDetected()) {
|
||||
connection_status_ = "Waiting for daemon config...";
|
||||
connection_status_ = TR("sb_waiting_config");
|
||||
VERBOSE_LOGF("[connect #%d] External daemon detected but no config yet, will retry...\n", connect_attempt);
|
||||
core_timer_ = CORE_INTERVAL_DEFAULT - 1.0f;
|
||||
} else {
|
||||
@@ -141,7 +142,7 @@ void App::tryConnect()
|
||||
return;
|
||||
}
|
||||
|
||||
connection_status_ = "Connecting to dragonxd...";
|
||||
connection_status_ = TR("sb_connecting_daemon");
|
||||
VERBOSE_LOGF("[connect #%d] Connecting to %s:%s (user=%s)\n",
|
||||
connect_attempt, config.host.c_str(), config.port.c_str(), config.rpcuser.c_str());
|
||||
|
||||
@@ -235,7 +236,7 @@ void App::tryConnect()
|
||||
onConnected();
|
||||
} else {
|
||||
state_.connected = false;
|
||||
connection_status_ = "Auth failed — check rpcuser/rpcpassword";
|
||||
connection_status_ = TR("sb_auth_failed");
|
||||
VERBOSE_LOGF("[connect #%d] .cookie auth also failed\n", attempt);
|
||||
ui::Notifications::instance().error(
|
||||
"RPC authentication failed (HTTP 401). "
|
||||
@@ -248,7 +249,7 @@ void App::tryConnect()
|
||||
}
|
||||
state_.connected = false;
|
||||
std::string confPath = rpc::Connection::getDefaultConfPath();
|
||||
connection_status_ = "Auth failed — check rpcuser/rpcpassword";
|
||||
connection_status_ = TR("sb_auth_failed");
|
||||
VERBOSE_LOGF("[connect #%d] HTTP 401 — rpcuser/rpcpassword in %s don't match the daemon. "
|
||||
"Edit the file or restart the daemon to regenerate credentials.\n",
|
||||
attempt, confPath.c_str());
|
||||
@@ -261,9 +262,10 @@ void App::tryConnect()
|
||||
// Show the actual RPC error alongside the waiting message so
|
||||
// auth mismatches and timeouts aren't silently hidden.
|
||||
if (!connectErr.empty()) {
|
||||
connection_status_ = "Waiting for dragonxd — " + connectErr;
|
||||
char buf[256]; snprintf(buf, sizeof(buf), TR("sb_waiting_daemon_err"), connectErr.c_str());
|
||||
connection_status_ = buf;
|
||||
} else {
|
||||
connection_status_ = "Waiting for dragonxd to start...";
|
||||
connection_status_ = TR("sb_waiting_daemon");
|
||||
}
|
||||
VERBOSE_LOGF("[connect #%d] RPC connection failed (%s) — daemon still starting, will retry...\n",
|
||||
attempt, connectErr.c_str());
|
||||
@@ -271,9 +273,10 @@ void App::tryConnect()
|
||||
} else if (externalDetected) {
|
||||
state_.connected = false;
|
||||
if (!connectErr.empty()) {
|
||||
connection_status_ = "Connecting to daemon — " + connectErr;
|
||||
char buf[256]; snprintf(buf, sizeof(buf), TR("sb_connecting_err"), connectErr.c_str());
|
||||
connection_status_ = buf;
|
||||
} else {
|
||||
connection_status_ = "Connecting to external daemon...";
|
||||
connection_status_ = TR("sb_connecting_external");
|
||||
}
|
||||
VERBOSE_LOGF("[connect #%d] External daemon detected but RPC failed (%s), will retry...\n",
|
||||
attempt, connectErr.c_str());
|
||||
@@ -285,15 +288,16 @@ void App::tryConnect()
|
||||
if (use_embedded_daemon_ && !isEmbeddedDaemonRunning()) {
|
||||
// Prevent infinite crash-restart loop
|
||||
if (embedded_daemon_ && embedded_daemon_->getCrashCount() >= 3) {
|
||||
connection_status_ = "Daemon crashed " + std::to_string(embedded_daemon_->getCrashCount()) + " times";
|
||||
{ char buf[128]; snprintf(buf, sizeof(buf), TR("sb_daemon_crashed"), embedded_daemon_->getCrashCount());
|
||||
connection_status_ = buf; }
|
||||
VERBOSE_LOGF("[connect #%d] Daemon crashed %d times — not restarting (use Settings > Restart Daemon to retry)\n",
|
||||
attempt, embedded_daemon_->getCrashCount());
|
||||
} else {
|
||||
connection_status_ = "Starting dragonxd...";
|
||||
connection_status_ = TR("sb_starting_daemon");
|
||||
if (startEmbeddedDaemon()) {
|
||||
VERBOSE_LOGF("[connect #%d] Embedded daemon starting, will retry connection...\n", attempt);
|
||||
} else if (embedded_daemon_ && embedded_daemon_->externalDaemonDetected()) {
|
||||
connection_status_ = "Connecting to daemon...";
|
||||
connection_status_ = TR("sb_connecting_generic");
|
||||
VERBOSE_LOGF("[connect #%d] External daemon detected, will connect via RPC...\n", attempt);
|
||||
} else {
|
||||
VERBOSE_LOGF("[connect #%d] Failed to start embedded daemon — lastError: %s\n",
|
||||
@@ -317,7 +321,7 @@ void App::tryConnect()
|
||||
void App::onConnected()
|
||||
{
|
||||
state_.connected = true;
|
||||
connection_status_ = "Connected";
|
||||
connection_status_ = TR("connected");
|
||||
|
||||
// Reset crash counter on successful connection
|
||||
if (embedded_daemon_) {
|
||||
@@ -597,7 +601,7 @@ void App::refreshCoreData()
|
||||
state_.warming_up = false;
|
||||
state_.warmup_status.clear();
|
||||
state_.warmup_description.clear();
|
||||
connection_status_ = "Connected";
|
||||
connection_status_ = TR("connected");
|
||||
VERBOSE_LOGF("[warmup] Daemon ready, warmup complete\n");
|
||||
// Parse initial info
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user