Skip to content

Commit 59e7121

Browse files
committed
>> 增加自动更新(手动检测)
>> 更改菜单结构
1 parent a628559 commit 59e7121

File tree

2 files changed

+195
-58
lines changed

2 files changed

+195
-58
lines changed

src/config.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pub struct AppConfig {
2727
pub enable_indicator: bool,
2828
pub last_check_time: u64,
2929
pub ignored_version: String,
30+
pub output_language: String, // "auto", "zh", "en", etc.
3031
}
3132

3233
impl Default for AppConfig {
@@ -38,13 +39,14 @@ impl Default for AppConfig {
3839
allow_emoji: true, // 默认开启
3940
allow_punctuation: true, // 默认开启
4041
show_log: false, // 默认关闭
41-
language: "zh".to_string(), // 默认中文
42+
language: "zh".to_string(), // 默认中文 (Interface)
4243
output_mode: "clipboard".to_string(),
4344
autostart: false,
4445
hotkey: 0x71, // 默认 F2
4546
enable_indicator: true,
4647
last_check_time: 0,
4748
ignored_version: String::new(),
49+
output_language: "auto".to_string(),
4850
}
4951
}
5052
}
@@ -191,6 +193,14 @@ impl ConfigManager {
191193
self.config.lock().unwrap().ignored_version = version;
192194
}
193195

196+
pub fn output_language(&self) -> String {
197+
self.config.lock().unwrap().output_language.clone()
198+
}
199+
200+
pub fn set_output_language(&self, lang: String) {
201+
self.config.lock().unwrap().output_language = lang;
202+
}
203+
194204
pub fn reset_ai_config(&self) {
195205
let mut cfg = self.config.lock().unwrap();
196206
cfg.api_key = AppConfig::default().api_key;

0 commit comments

Comments
 (0)