From 5d6efd46ec0c93b381ec7578561a1273c366025b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Fri, 9 Oct 2026 12:01:50 -0400 Subject: [PATCH] Update banner and dialog: texts from the built-in English and Chinese catalog (Ely UPD-1) --- src/i18n/builtin.rs | 20 ++++++++++++++++++++ src/shell/update.rs | 35 +++++++++++++++++++++-------------- 2 files changed, 41 insertions(+), 14 deletions(-) diff --git a/src/i18n/builtin.rs b/src/i18n/builtin.rs index 7135fce..a81ab97 100644 --- a/src/i18n/builtin.rs +++ b/src/i18n/builtin.rs @@ -41,6 +41,16 @@ const EN: &[(&str, &str)] = &[ ("templates.use", "Use template"), ("templates.none", "No template matches"), ("comments.reply", "Reply"), + ("update.title", "Software Update"), + ("update.available", "Version {version} is available."), + ("update.downloading", "Downloading {version}… {percent}%"), + ("update.ready", "Version {version} is ready."), + ("update.download", "Download"), + ("update.restart", "Restart to update"), + ("update.later", "Later"), + ("update.headline.available", "{name} {version} is available"), + ("update.headline.ready", "{name} {version} is ready"), + ("update.current", "You have {current}."), ("comments.resolve", "Resolve"), ("comments.reopen", "Reopen"), ("comments.open", "Open {n}"), @@ -142,6 +152,16 @@ const ZH_CN: &[(&str, &str)] = &[ ("templates.use", "使用模板"), ("templates.none", "没有匹配的模板"), ("comments.reply", "回复"), + ("update.title", "软件更新"), + ("update.available", "{version} 版可以更新。"), + ("update.downloading", "正在下载 {version}… {percent}%"), + ("update.ready", "{version} 版已下载好。"), + ("update.download", "下载"), + ("update.restart", "重新启动以更新"), + ("update.later", "以后"), + ("update.headline.available", "{name} {version} 可以更新"), + ("update.headline.ready", "{name} {version} 已下载好"), + ("update.current", "当前为 {current}。"), ("comments.resolve", "解决"), ("comments.reopen", "重新打开"), ("comments.open", "未解决 {n}"), diff --git a/src/shell/update.rs b/src/shell/update.rs index ede95b8..353d1af 100644 --- a/src/shell/update.rs +++ b/src/shell/update.rs @@ -8,6 +8,7 @@ use gpui::{ use super::{Hosted, open_hosted}; use crate::{ buttons::{Button, ButtonVariant, IconButton}, + i18n::text, layout::ScrollArea, motion::ProgressBar, primitives::{Icon, IconName}, @@ -43,7 +44,7 @@ fn progress_line(state: UpdateState) -> Option { } } -fn buttons(state: UpdateState, actions: &Actions, size: ControlSize) -> Vec