Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

fix(updates): localize the update status messages and format the sources

Dylan M. Tayloredec344ee7c1
diff --git a/crates/ui-egui/src/updates_ui.rs b/crates/ui-egui/src/updates_ui.rs
index 3b08ee5cc..43803c9a5 100644
--- a/crates/ui-egui/src/updates_ui.rs
+++ b/crates/ui-egui/src/updates_ui.rs
@@ -94,9 +94,15 @@ pub(crate) fn show(app: &mut DesignApp, ctx: &egui::Context) {
let rt = &mut app.updates_rt;
(rt.manual_window_open, rt.status_message) = match rt.updater.status() {
Status::Idle => (false, None),
- Status::Checking => (true, Some("Checking for updates…".to_string())),
- Status::UpToDate => (true, Some(format!("DesignCraft {} is currently the newest version available.", env!("CARGO_PKG_VERSION")))),
- Status::Failed(e) => (true, Some(format!("Could not check for updates:\n{e}"))),
+ Status::Checking => (true, Some(crate::i18n::tr(&app.ui.language, "Checking for updates…").to_string())),
+ Status::UpToDate => (
+ true,
+ Some(
+ crate::i18n::tr(&app.ui.language, "DesignCraft {version} is currently the newest version available.")
+ .replace("{version}", env!("CARGO_PKG_VERSION")),
+ ),
+ ),
+ Status::Failed(e) => (true, Some(crate::i18n::tr(&app.ui.language, "Could not check for updates:\n{error}").replace("{error}", e))),
};
}