Skip to content

LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust

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

Dylan M. Taylor015ca9eebae7
diff --git a/crates/ui-egui/src/updates_ui.rs b/crates/ui-egui/src/updates_ui.rs
index 92f421e45..5e159a0f4 100644
--- a/crates/ui-egui/src/updates_ui.rs
+++ b/crates/ui-egui/src/updates_ui.rs
@@ -107,9 +107,15 @@ pub(crate) fn show(app: &mut LightcraftApp, 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!("LightCraft {} 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("Checking for updates…").to_string())),
+ Status::UpToDate => (
+ true,
+ Some(
+ crate::i18n::tr("LightCraft {version} is currently the newest version available.")
+ .replace("{version}", env!("CARGO_PKG_VERSION")),
+ ),
+ ),
+ Status::Failed(e) => (true, Some(crate::i18n::tr("Could not check for updates:\n{error}").replace("{error}", e))),
};
}