feat: add i18n support with auto language detection for GUI#17
Closed
iamvicliu wants to merge 5 commits intoo1xhack:mainfrom
Closed
feat: add i18n support with auto language detection for GUI#17iamvicliu wants to merge 5 commits intoo1xhack:mainfrom
iamvicliu wants to merge 5 commits intoo1xhack:mainfrom
Conversation
Translate all user-facing text in the web GUI to Simplified Chinese, including page titles, labels, buttons, tooltips, status messages, validation errors, and timezone/time-format presets. Cache-busting query strings added to static asset URLs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a client-side i18n system that automatically detects browser language via navigator.language and switches between English and Chinese (zh-CN). All 150+ user-facing strings are now translatable through a centralized translation table in JavaScript, keeping the Python backend language-neutral. - English and Chinese translation tables with t()/tf() helper functions - Timezone preset and time format unit label translation via tLabel() - Dynamic HTML lang attribute and page title based on detected language - All 20 GUI-related tests pass Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace Chinese quotes "" with brackets 「」 to avoid breaking the JavaScript string literal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
A stray Unicode left/right double quotation mark (U+201C/U+201D) broke the JavaScript template literal at runtime. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Append ?v=2 to app.js and app.css references in HTML to ensure browsers load the updated i18n version instead of cached copies. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
|
Merged into dev and included in v1.6.0 release PR #19 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
navigator.languagezh-CN) browsers see Chinese UI; all others see English (default)How language detection works
navigator.language(e.g."zh-CN","en-US","ja")"zh"→ use Chinese translations; otherwise → use English (default)t("key")— returns the localized string for a given keytf("key", {param: value})— returns a localized string with parameter substitution (e.g.tf("runningPid", {pid: 1234})→"运行中 (pid 1234)")tLabel(label)— translates timezone/time-format preset labels sent from the server (e.g."China - Shanghai"→"中国 - 上海")langattribute and page<title>also update dynamically based on detected languageNo server-side changes are needed — the backend always sends English labels, and the JS layer translates them on the client side if the browser language is Chinese.
Scope
telegram_watch/gui.py— ~430 insertions, ~125 deletionsTest plan
node --check🤖 Generated with Claude Code