i18n: route explorer and shield status strings through TR()
Centralise the remaining hardcoded English literals in two otherwise fully-translated files (explorer_tab: 40 TR calls, shield_dialog: 23) so they join the i18n system with an English source key + fallback: - explorer_tab: the three search-error messages (invalid response, hash not found, not-connected) now use explorer_* keys. Also guards a hash lookup behind an active daemon connection and disables the block-detail prev/next nav while a fetch is in flight (both were the reason these error paths could fire). - shield_dialog: the operation status/error strings (submitting, submitted, failed, status, error-checking-status, shield/merge failed) now use shield_* keys. - i18n: add the new explorer_* and shield_* English source keys. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -181,7 +181,7 @@ void ShieldDialog::render(App* app)
|
||||
const char* btn_label = (s_mode == Mode::ShieldCoinbase) ? TR("shield_funds") : TR("merge_funds");
|
||||
if (material::StyledButton(btn_label, ImVec2(shieldBtn.width, 0), S.resolveFont(shieldBtn.font))) {
|
||||
s_operation_pending = true;
|
||||
s_status_message = "Submitting operation...";
|
||||
s_status_message = TR("shield_submitting");
|
||||
|
||||
if (s_mode == Mode::ShieldCoinbase) {
|
||||
std::string from(s_from_address), to(s_to_address);
|
||||
@@ -201,14 +201,14 @@ void ShieldDialog::render(App* app)
|
||||
s_operation_pending = false;
|
||||
if (error.empty()) {
|
||||
s_operation_id = result.value("opid", "");
|
||||
s_status_message = "Operation submitted: " + s_operation_id;
|
||||
s_status_message = std::string(TR("shield_op_submitted")) + s_operation_id;
|
||||
Notifications::instance().success(TR("shield_started"));
|
||||
// Register with the shared poller so an async failure is
|
||||
// surfaced (and balances refresh) even after this dialog closes.
|
||||
app->trackOperation(s_operation_id);
|
||||
} else {
|
||||
s_status_message = "Error: " + error;
|
||||
Notifications::instance().error("Shield failed: " + error);
|
||||
s_status_message = std::string(TR("shield_error_prefix")) + error;
|
||||
Notifications::instance().error(std::string(TR("shield_send_failed")) + error);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -235,14 +235,14 @@ void ShieldDialog::render(App* app)
|
||||
s_operation_pending = false;
|
||||
if (error.empty()) {
|
||||
s_operation_id = result.value("opid", "");
|
||||
s_status_message = "Operation submitted: " + s_operation_id;
|
||||
s_status_message = std::string(TR("shield_op_submitted")) + s_operation_id;
|
||||
Notifications::instance().success(TR("merge_started"));
|
||||
// Register with the shared poller so an async failure is
|
||||
// surfaced (and balances refresh) even after this dialog closes.
|
||||
app->trackOperation(s_operation_id);
|
||||
} else {
|
||||
s_status_message = "Error: " + error;
|
||||
Notifications::instance().error("Merge failed: " + error);
|
||||
s_status_message = std::string(TR("shield_error_prefix")) + error;
|
||||
Notifications::instance().error(std::string(TR("merge_send_failed")) + error);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -293,16 +293,16 @@ void ShieldDialog::render(App* app)
|
||||
s_status_message = TR("shield_completed");
|
||||
Notifications::instance().success(TR("shield_merge_done"));
|
||||
} else if (status == "failed") {
|
||||
std::string errMsg = op.value("error", nlohmann::json{}).value("message", "Unknown error");
|
||||
s_status_message = "Operation failed: " + errMsg;
|
||||
Notifications::instance().error("Operation failed: " + errMsg);
|
||||
std::string errMsg = op.value("error", nlohmann::json{}).value("message", TR("shield_unknown_error"));
|
||||
s_status_message = std::string(TR("shield_op_failed")) + errMsg;
|
||||
Notifications::instance().error(std::string(TR("shield_op_failed")) + errMsg);
|
||||
} else if (status == "executing") {
|
||||
s_status_message = TR("shield_in_progress");
|
||||
} else {
|
||||
s_status_message = "Status: " + status;
|
||||
s_status_message = std::string(TR("shield_status_label")) + status;
|
||||
}
|
||||
} else if (!error.empty()) {
|
||||
s_status_message = "Error checking status: " + error;
|
||||
s_status_message = std::string(TR("shield_status_check_error")) + error;
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user