feat: Full UI internationalization, pool hashrate stats, and layout caching
- Replace all hardcoded English strings with TR() translation keys across every tab, dialog, and component (~20 UI files) - Expand all 8 language files (de, es, fr, ja, ko, pt, ru, zh) with complete translations (~37k lines added) - Improve i18n loader with exe-relative path fallback and English base fallback for missing keys - Add pool-side hashrate polling via pool stats API in xmrig_manager - Introduce Layout::beginFrame() per-frame caching and refresh balance layout config only on schema generation change - Offload daemon output parsing to worker thread - Add CJK subset fallback font for Chinese/Japanese/Korean glyphs
This commit is contained in:
@@ -44,7 +44,7 @@ void TransactionDetailsDialog::render(App* app)
|
||||
auto memoInput = S.input("dialogs.transaction-details", "memo-input");
|
||||
auto bottomBtn = S.button("dialogs.transaction-details", "bottom-button");
|
||||
|
||||
if (material::BeginOverlayDialog("Transaction Details", &s_open, win.width, 0.94f)) {
|
||||
if (material::BeginOverlayDialog(TR("tx_details_title"), &s_open, win.width, 0.94f)) {
|
||||
const auto& tx = s_transaction;
|
||||
|
||||
// Type indicator with color
|
||||
@@ -52,16 +52,16 @@ void TransactionDetailsDialog::render(App* app)
|
||||
std::string type_display;
|
||||
if (tx.type == "receive") {
|
||||
type_color = ImVec4(0.3f, 0.8f, 0.3f, 1.0f);
|
||||
type_display = "RECEIVED";
|
||||
type_display = TR("tx_received");
|
||||
} else if (tx.type == "send") {
|
||||
type_color = ImVec4(0.8f, 0.3f, 0.3f, 1.0f);
|
||||
type_display = "SENT";
|
||||
type_display = TR("tx_sent");
|
||||
} else if (tx.type == "generate" || tx.type == "mined") {
|
||||
type_color = ImVec4(0.3f, 0.6f, 0.9f, 1.0f);
|
||||
type_display = "MINED";
|
||||
type_display = TR("tx_mined");
|
||||
} else if (tx.type == "immature") {
|
||||
type_color = ImVec4(0.8f, 0.8f, 0.3f, 1.0f);
|
||||
type_display = "IMMATURE";
|
||||
type_display = TR("tx_immature");
|
||||
} else {
|
||||
type_color = ImVec4(0.7f, 0.7f, 0.7f, 1.0f);
|
||||
type_display = tx.type;
|
||||
@@ -72,11 +72,11 @@ void TransactionDetailsDialog::render(App* app)
|
||||
|
||||
// Confirmations badge
|
||||
if (tx.confirmations == 0) {
|
||||
ImGui::TextColored(ImVec4(0.8f, 0.6f, 0.0f, 1.0f), "Pending");
|
||||
ImGui::TextColored(ImVec4(0.8f, 0.6f, 0.0f, 1.0f), "%s", TR("pending"));
|
||||
} else if (tx.confirmations < 10) {
|
||||
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.3f, 1.0f), "%d confirmations", tx.confirmations);
|
||||
ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.3f, 1.0f), TR("tx_confirmations"), tx.confirmations);
|
||||
} else {
|
||||
ImGui::TextColored(ImVec4(0.3f, 0.8f, 0.3f, 1.0f), "%d confirmations", tx.confirmations);
|
||||
ImGui::TextColored(ImVec4(0.3f, 0.8f, 0.3f, 1.0f), TR("tx_confirmations"), tx.confirmations);
|
||||
}
|
||||
|
||||
ImGui::Spacing();
|
||||
@@ -84,7 +84,7 @@ void TransactionDetailsDialog::render(App* app)
|
||||
ImGui::Spacing();
|
||||
|
||||
// Amount (prominent display)
|
||||
ImGui::Text("Amount:");
|
||||
ImGui::Text("%s", TR("amount_label"));
|
||||
ImGui::SameLine(lbl.position);
|
||||
if (tx.amount >= 0) {
|
||||
ImGui::TextColored(ImVec4(0.3f, 0.8f, 0.3f, 1.0f), "+%.8f DRGX", tx.amount);
|
||||
@@ -102,7 +102,7 @@ void TransactionDetailsDialog::render(App* app)
|
||||
ImGui::Spacing();
|
||||
|
||||
// Date/Time
|
||||
ImGui::Text("Date:");
|
||||
ImGui::Text("%s", TR("date_label"));
|
||||
ImGui::SameLine(lbl.position);
|
||||
ImGui::Text("%s", tx.getTimeString().c_str());
|
||||
|
||||
@@ -111,7 +111,7 @@ void TransactionDetailsDialog::render(App* app)
|
||||
ImGui::Spacing();
|
||||
|
||||
// Transaction ID
|
||||
ImGui::Text("Transaction ID:");
|
||||
ImGui::Text("%s", TR("tx_id_label"));
|
||||
char txid_buf[128];
|
||||
strncpy(txid_buf, tx.txid.c_str(), sizeof(txid_buf) - 1);
|
||||
txid_buf[sizeof(txid_buf) - 1] = '\0';
|
||||
@@ -126,7 +126,7 @@ void TransactionDetailsDialog::render(App* app)
|
||||
|
||||
// Address
|
||||
if (!tx.address.empty()) {
|
||||
ImGui::Text(tx.type == "send" ? "To Address:" : "From Address:");
|
||||
ImGui::Text("%s", tx.type == "send" ? TR("tx_to_address") : TR("tx_from_address"));
|
||||
|
||||
// Use multiline for z-addresses
|
||||
if (tx.address.length() > 50) {
|
||||
@@ -155,7 +155,7 @@ void TransactionDetailsDialog::render(App* app)
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::Text("Memo:");
|
||||
ImGui::Text("%s", TR("memo_label"));
|
||||
char memo_buf[512];
|
||||
strncpy(memo_buf, tx.memo.c_str(), sizeof(memo_buf) - 1);
|
||||
memo_buf[sizeof(memo_buf) - 1] = '\0';
|
||||
@@ -173,7 +173,7 @@ void TransactionDetailsDialog::render(App* app)
|
||||
float start_x = (ImGui::GetWindowWidth() - total_width) / 2.0f;
|
||||
ImGui::SetCursorPosX(start_x);
|
||||
|
||||
if (material::StyledButton("View on Explorer", ImVec2(button_width, 0), S.resolveFont(bottomBtn.font))) {
|
||||
if (material::StyledButton(TR("tx_view_explorer"), ImVec2(button_width, 0), S.resolveFont(bottomBtn.font))) {
|
||||
std::string url = app->settings()->getTxExplorerUrl() + tx.txid;
|
||||
// Platform-specific URL opening
|
||||
#ifdef _WIN32
|
||||
@@ -189,7 +189,7 @@ void TransactionDetailsDialog::render(App* app)
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
if (material::StyledButton("Close", ImVec2(button_width, 0), S.resolveFont(bottomBtn.font))) {
|
||||
if (material::StyledButton(TR("close"), ImVec2(button_width, 0), S.resolveFont(bottomBtn.font))) {
|
||||
s_open = false;
|
||||
}
|
||||
material::EndOverlayDialog();
|
||||
|
||||
Reference in New Issue
Block a user