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:
@@ -61,11 +61,8 @@ void BackupWalletDialog::render(App* app)
|
||||
auto backupBtn = S.button("dialogs.backup-wallet", "backup-button");
|
||||
auto closeBtn = S.button("dialogs.backup-wallet", "close-button");
|
||||
|
||||
if (material::BeginOverlayDialog("Backup Wallet", &s_open, win.width, 0.94f)) {
|
||||
ImGui::TextWrapped(
|
||||
"Create a backup of your wallet.dat file. This file contains all your "
|
||||
"private keys and transaction history. Store the backup in a secure location."
|
||||
);
|
||||
if (material::BeginOverlayDialog(TR("backup_title"), &s_open, win.width, 0.94f)) {
|
||||
ImGui::TextWrapped("%s", TR("backup_description"));
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
@@ -76,7 +73,7 @@ void BackupWalletDialog::render(App* app)
|
||||
}
|
||||
|
||||
// Destination path
|
||||
ImGui::Text("Backup destination:");
|
||||
ImGui::Text("%s", TR("backup_destination"));
|
||||
ImGui::SetNextItemWidth(-1);
|
||||
ImGui::InputText("##Destination", s_destination, sizeof(s_destination));
|
||||
|
||||
@@ -84,13 +81,13 @@ void BackupWalletDialog::render(App* app)
|
||||
|
||||
// Show wallet.dat location
|
||||
std::string walletPath = util::Platform::getDataDir() + "/wallet.dat";
|
||||
ImGui::TextDisabled("Source: %s", walletPath.c_str());
|
||||
ImGui::TextDisabled(TR("backup_source"), walletPath.c_str());
|
||||
|
||||
// Check if source exists
|
||||
bool sourceExists = fs::exists(walletPath);
|
||||
if (!sourceExists) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.0f, 0.4f, 0.4f, 1.0f));
|
||||
ImGui::Text("Warning: wallet.dat not found at expected location");
|
||||
ImGui::Text("%s", TR("backup_wallet_not_found"));
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
|
||||
@@ -107,7 +104,7 @@ void BackupWalletDialog::render(App* app)
|
||||
ImGui::BeginDisabled();
|
||||
}
|
||||
|
||||
if (material::StyledButton("Create Backup", ImVec2(backupBtn.width, 0), S.resolveFont(backupBtn.font))) {
|
||||
if (material::StyledButton(TR("backup_create"), ImVec2(backupBtn.width, 0), S.resolveFont(backupBtn.font))) {
|
||||
if (strlen(s_destination) == 0) {
|
||||
Notifications::instance().warning("Please enter a destination path");
|
||||
} else if (!app->rpc() || !app->rpc()->isConnected()) {
|
||||
@@ -147,7 +144,7 @@ void BackupWalletDialog::render(App* app)
|
||||
s_status = statusMsg;
|
||||
s_backing_up = false;
|
||||
if (success) {
|
||||
Notifications::instance().success("Wallet backup created");
|
||||
Notifications::instance().success(TR("backup_created"));
|
||||
} else {
|
||||
Notifications::instance().warning(statusMsg);
|
||||
}
|
||||
@@ -160,11 +157,11 @@ void BackupWalletDialog::render(App* app)
|
||||
if (s_backing_up) {
|
||||
ImGui::EndDisabled();
|
||||
ImGui::SameLine();
|
||||
ImGui::TextDisabled("Backing up...");
|
||||
ImGui::TextDisabled("%s", TR("backup_backing_up"));
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
if (material::StyledButton("Close", ImVec2(closeBtn.width, 0), S.resolveFont(closeBtn.font))) {
|
||||
if (material::StyledButton(TR("close"), ImVec2(closeBtn.width, 0), S.resolveFont(closeBtn.font))) {
|
||||
s_open = false;
|
||||
}
|
||||
|
||||
@@ -179,10 +176,10 @@ void BackupWalletDialog::render(App* app)
|
||||
ImGui::Spacing();
|
||||
|
||||
// Tips
|
||||
ImGui::TextDisabled("Tips:");
|
||||
ImGui::BulletText("Store backups on external drives or cloud storage");
|
||||
ImGui::BulletText("Create multiple backups in different locations");
|
||||
ImGui::BulletText("Test restoring from backup periodically");
|
||||
ImGui::TextDisabled("%s", TR("backup_tips"));
|
||||
ImGui::BulletText("%s", TR("backup_tip_external"));
|
||||
ImGui::BulletText("%s", TR("backup_tip_multiple"));
|
||||
ImGui::BulletText("%s", TR("backup_tip_test"));
|
||||
material::EndOverlayDialog();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user