i18n: localize UI chrome (en/zh-TW) + English operator messages - #4
Merged
Conversation
The generated content already follows the reader's language; this extends locale
awareness to the fixed UI chrome so an English reader gets an all-English issue
instead of English content inside Chinese labels.
- src/i18n.ts: a UI string table (section headers, stat labels, signal/device
strings, issue note, figures, colophon, dates, archive showcase, email subject
and button). Traditional Chinese values are the originals verbatim, so zh-TW
output is unchanged; unsupported locales fall back to English.
- src/locale.ts: resolveContentLocale() now returns { code, name } — the code
drives the UI table and the html lang attribute; the name still drives prompts.
- issueView / preview / archive / email / send render via the resolved strings;
html lang reflects the locale; dates are formatted per locale.
Verified: typecheck, 18 security tests, gates; both locales render (en → English
chrome + lang="en"; zh-TW unchanged).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Console logs, error messages, and osascript notifications are operator-facing — translate the remaining Chinese in them to English for global maintainers. Reader- facing content is untouched: LLM output follows the reader's language (locale.ts), and the fixed UI chrome is localized via i18n.ts. Preserves interpolations, embedded commands (security add-generic-password, npm rebuild better-sqlite3, launchctl …), URLs/ports, and symbols. install-weekly's dayNames array is now English abbreviations since it feeds a scheduled-output log line. Verified: typecheck, 18 security tests, gates; no Chinese remains in any console.log/error/throw. The only intentional Chinese left is the zh-TW UI table (i18n.ts), the native-name override map (locale.ts), the locale-switch labels, the extension popup UI, and a doc example. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A cinema showtimes page (ws.vscinemas.com.tw) leaked into an issue — it was 'unknown' at the URL layer and the LLM knowledge classifier over-included it. That violates the editorial rule (entertainment / event signups are excluded regardless of dwell time). Two-layer fix: - classify/filter.ts: add a deterministic noise belt for cinema showtimes and event-ticketing platforms (vscinemas, kktix, accupass, opentix, ibon, famiticket). - pipeline/enrich.ts: sharpen the LLM gate — knowledge must teach/explain/analyze/ argue with substance; explicitly exclude showtimes, ticketing/booking/reservation, event signups, product/store pages, menus, schedules, and transactional/logistics pages. Rule of thumb: if a page is about DOING or BUYING something rather than UNDERSTANDING something, it is not knowledge. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- The №0 special title (創刊預覽號) is now in i18n.ts (inauguralTitle) and resolved per locale at render time, so English readers see "Inaugural Preview" — the last fixed UI string that showed Chinese to English readers. - The email subject now carries the weekly reading digest: "Browstack №N — <digest>" (en) / "Browstack №N|<digest>" (zh), falling back to the generic line when a digest is absent — so the inbox subject previews the week's themes. - Extension popup is bilingual: popup.ts localizes labels, status, and the privacy note off navigator.language (zh* → Traditional Chinese, else English); the HTML keeps Chinese as the no-JS fallback. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Resolves the two residuals flagged after the global-ready PR: the fixed UI chrome and operator-facing CLI messages.
1 · Localize the fixed UI chrome
Generated content already followed the reader's language; this extends locale awareness to the fixed chrome so an English reader gets an all-English issue instead of English content inside Chinese labels.
src/i18n.ts— a UI string table (section headers, stat labels, signal/device strings, issue note, figures, colophon, per-locale dates, archive showcase, email subject + button). Traditional Chinese values are the originals verbatim, so zh-TW output is byte-unchanged; unsupported locales fall back to English (extensible — add a locale by adding a table entry).src/locale.ts—resolveContentLocale()now returns{ code, name }: the code drives the UI table and thehtml langattribute; the name still drives LLM prompts.issueView/preview/archive/email/sendrender via the resolved strings; dates are formatted per locale.2 · Operator/CLI messages → English
Console logs, error messages, and macOS notifications are operator-facing — the remaining Chinese in them is translated to English for global maintainers. Reader-facing content is untouched. Embedded commands, URLs, interpolations, and symbols preserved.
Scope notes
i18n.ts, the native-name override map inlocale.ts, the extension popup UI (popup.ts), and a doc example.創刊預覽號) still shows in all locales — a single edge-case UI string; can be folded intoi18n.tsif desired.Verification
typecheck, the 18 security tests, and the security grep-gates all pass. Both locales render correctly (en → English chrome +lang="en"; zh-TW unchanged). No Chinese remains in anyconsole.log/error/throw.🤖 Generated with Claude Code