feat: 国际化 / 键盘操作 / 无障碍 / 性能优化
国际化 - 新增 ui/i18n 双语文案表(中文原文为 key,英文集中映射,tf 支持占位符) - AppSettings 增加 language(跟随系统/中文/English),启动与保存时即时生效 - 全部界面文案(标题栏/侧栏/工作区/发布/订阅/表单/设置/全部对话框/通知)入表 键盘操作 - Ctrl+W 关闭当前标签页;Ctrl+Tab / Ctrl+Shift+Tab 循环切换标签 - Ctrl+F 聚焦当前工作区消息过滤框 无障碍 - 全部纯图标按钮补 accessibility_label(屏幕阅读器 / UIA 自动化可识别) 性能 - 折叠态预览(JSON 美化/压平+截断)改为入环形缓冲时计算一次, 随 MqttRecord 缓存(Arc<str>),渲染热路径对最多数百条可见行 不再逐帧重复 serde_json 解析
This commit is contained in:
@@ -7,6 +7,7 @@ use gpui_kit::{ Context, Window, };
|
||||
|
||||
|
||||
use super::*;
|
||||
use crate::ui::i18n;
|
||||
|
||||
impl MqttXApp {
|
||||
/// 数据目录(设置对话框展示 / 打开用)。
|
||||
@@ -76,9 +77,12 @@ impl MqttXApp {
|
||||
let count = app.connections.len();
|
||||
match crate::store::export_connections_to(&path, &app.connections) {
|
||||
Ok(()) => window.push_notification(
|
||||
Notification::success(format!(
|
||||
"已导出 {count} 条连接到 {}",
|
||||
path.display()
|
||||
Notification::success(i18n::tf(
|
||||
"导出 {n} 条连接到 {path}",
|
||||
&[
|
||||
("n", &count.to_string()),
|
||||
("path", &path.display().to_string()),
|
||||
],
|
||||
)),
|
||||
cx,
|
||||
),
|
||||
@@ -129,7 +133,13 @@ impl MqttXApp {
|
||||
app.storage.save_connections(&app.connections);
|
||||
}
|
||||
window.push_notification(
|
||||
Notification::success(format!("导入 {added} 条,跳过 {skipped} 条")),
|
||||
Notification::success(i18n::tf(
|
||||
"导入 {n} 条,跳过 {n2} 条",
|
||||
&[
|
||||
("n", &added.to_string()),
|
||||
("n2", &skipped.to_string()),
|
||||
],
|
||||
)),
|
||||
cx,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user