diff --git a/easytier-gui/src-tauri/src/main.rs b/easytier-gui/src-tauri/src/main.rs
index 05e02711..88c0a18b 100644
--- a/easytier-gui/src-tauri/src/main.rs
+++ b/easytier-gui/src-tauri/src/main.rs
@@ -286,6 +286,7 @@ fn toggle_window_visibility(window: &Window) {
window.hide().unwrap();
} else {
window.show().unwrap();
+ window.set_focus().unwrap();
}
}
@@ -305,8 +306,8 @@ fn main() {
if !check_sudo() {
process::exit(0);
}
- let quit = CustomMenuItem::new("quit".to_string(), "Quit");
- let hide = CustomMenuItem::new("hide".to_string(), "Show / Hide");
+ let quit = CustomMenuItem::new("quit".to_string(), "退出 Quit");
+ let hide = CustomMenuItem::new("hide".to_string(), "显示 Show / 隐藏 Hide");
let tray_menu = SystemTrayMenu::new()
.add_item(quit)
.add_native_item(SystemTrayMenuItem::Separator)
diff --git a/easytier-gui/src/App.vue b/easytier-gui/src/App.vue
index 520a0adf..69e67eaa 100644
--- a/easytier-gui/src/App.vue
+++ b/easytier-gui/src/App.vue
@@ -147,7 +147,7 @@ const toggle_setting_menu = (event: any) => {
onMounted(async () => {
networkStore.loadFromLocalStorage();
- loadLocaleFromLocalStorage();
+ changeLocale(loadLocaleFromLocalStorage());
});
@@ -205,7 +205,7 @@ onMounted(async () => {
-
diff --git a/easytier-gui/src/components/Config.vue b/easytier-gui/src/components/Config.vue
index fd73c774..f6fc6f37 100644
--- a/easytier-gui/src/components/Config.vue
+++ b/easytier-gui/src/components/Config.vue
@@ -145,7 +145,7 @@ const presetPublicServers = [
-
diff --git a/easytier-gui/src/main.ts b/easytier-gui/src/main.ts
index f5438edd..b22287b1 100644
--- a/easytier-gui/src/main.ts
+++ b/easytier-gui/src/main.ts
@@ -235,7 +235,6 @@ const messages = {
"instance_id": "Instance ID",
"network_infos": "Network Infos",
"parse_network_config": "Parse Network Config",
- "run_network_instance": "Run Network Instance",
"retain_network_instance": "Retain Network Instance",
"collect_network_infos": "Collect Network Infos",
"settings": "Settings",
@@ -262,6 +261,9 @@ const messages = {
"upload_bytes": "Upload",
"download_bytes": "Download",
"loss_rate": "Loss Rate",
+
+ "run_network": "Run Network",
+ "stop_network": "Stop Network",
},
cn: {
"network": "网络",
@@ -292,7 +294,6 @@ const messages = {
"instance_id": "实例ID",
"network_infos": "网络信息",
"parse_network_config": "解析网络配置",
- "run_network_instance": "运行网络实例",
"retain_network_instance": "保留网络实例",
"collect_network_infos": "收集网络信息",
"settings": "设置",
@@ -317,6 +318,9 @@ const messages = {
"upload_bytes": "上传",
"download_bytes": "下载",
"loss_rate": "丢包率",
+
+ "run_network": "运行网络",
+ "stop_network": "停止网络",
}
}
@@ -324,8 +328,13 @@ function saveLocaleToLocalStorage(locale: string) {
localStorage.setItem("locale", locale);
}
-export function loadLocaleFromLocalStorage(): string {
- return localStorage.getItem("locale") || "en";
+export function loadLocaleFromLocalStorage(): 'en' | 'cn' {
+ const v = localStorage.getItem("locale")
+ if (v === 'en' || v === 'cn') {
+ return v;
+ } else {
+ return 'en';
+ }
}
export const i18n = createI18n({