From a614c8973774f5e791541826045523c01f9f404e Mon Sep 17 00:00:00 2001 From: Steve Lau Date: Mon, 21 Oct 2024 22:21:03 +0800 Subject: [PATCH] refactor: add missing i18n for OpenBSD steps --- locales/app.yml | 12 ++++++++++++ src/steps/os/openbsd.rs | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/locales/app.yml b/locales/app.yml index 5dc8046b..265b9bd9 100644 --- a/locales/app.yml +++ b/locales/app.yml @@ -610,3 +610,15 @@ _version: 2 en: "Windows Update" es: "Actualización de Windows" zh_TW: "Windows 更新" +"Would check if OpenBSD is -current": + en: "Would check if OpenBSD is -current" + es: "Comprobaría si OpenBSD está en -current" + zh_TW: "會檢查 OpenBSD 是否為 -current" +"Would upgrade the OpenBSD system": + en: "Would upgrade the OpenBSD system" + es: "Actualizaría el sistema OpenBSD" + zh_TW: "會升級 OpenBSD 系統" +"Would upgrade OpenBSD packages": + en: "Would upgrade OpenBSD packages" + es: "Actualizaría los paquetes de OpenBSD" + zh_TW: "會升級 OpenBSD 套件" \ No newline at end of file diff --git a/src/steps/os/openbsd.rs b/src/steps/os/openbsd.rs index bc876a95..6b876595 100644 --- a/src/steps/os/openbsd.rs +++ b/src/steps/os/openbsd.rs @@ -10,7 +10,7 @@ fn is_openbsd_current(ctx: &ExecutionContext) -> Result { let motd_content = fs::read_to_string("/etc/motd")?; let is_current = motd_content.contains("-current"); if ctx.config().dry_run() { - println!("Would check if OpenBSD is -current"); + println!("{}", t!("Would check if OpenBSD is -current")); Ok(is_current) } else { Ok(is_current) @@ -24,7 +24,7 @@ pub fn upgrade_openbsd(ctx: &ExecutionContext) -> Result<()> { let is_current = is_openbsd_current(ctx)?; if ctx.config().dry_run() { - println!("Would upgrade the OpenBSD system"); + println!("{}", t!("Would upgrade the OpenBSD system")); return Ok(()); } @@ -43,7 +43,7 @@ pub fn upgrade_packages(ctx: &ExecutionContext) -> Result<()> { let is_current = is_openbsd_current(ctx)?; if ctx.config().dry_run() { - println!("Would upgrade OpenBSD packages"); + println!("{}", t!("Would upgrade OpenBSD packages")); return Ok(()); }