From bb1c045dd58c0d838ec1cd3c3bc8d2ea2217521b Mon Sep 17 00:00:00 2001 From: cmliu Date: Mon, 27 Jul 2026 20:34:21 +0800 Subject: [PATCH] feat: add multilingual support with language toggle and localization - Implemented language loading and switching functionality, allowing users to toggle between Chinese (zh-CN) and English (en). - Introduced a new LocalizedMessage interface and updated existing messages to support bilingual translations. - Refactored event labels and server messages to use a translation array for better localization management. - Added CSS styles for language toggle button and icons. - Created a new language-bootstrap module to handle initial language setup based on local storage or browser settings. --- .gitignore | 1 + frontend/index.html | 257 +++++++++++++++++++-------- frontend/src/language-bootstrap.ts | 13 ++ frontend/src/main.ts | 276 +++++++++++++++++++++++------ frontend/src/style.css | 61 +++++++ 5 files changed, 487 insertions(+), 121 deletions(-) create mode 100644 frontend/src/language-bootstrap.ts diff --git a/.gitignore b/.gitignore index c9cc801..cf1553a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ tests-edge/ .dev.vars .env* !.env.example +.workbuddy/ \ No newline at end of file diff --git a/frontend/index.html b/frontend/index.html index 52cbb41..beaab7e 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -2,58 +2,111 @@ + - + Workers WebSSH -
+