Skip to content

i18n: localize UI chrome (en/zh-TW) + English operator messages - #4

Merged
howieyoung merged 4 commits into
mainfrom
feat/i18n-ui-and-english-cli
Aug 8, 2026
Merged

i18n: localize UI chrome (en/zh-TW) + English operator messages#4
howieyoung merged 4 commits into
mainfrom
feat/i18n-ui-and-english-cli

Conversation

@howieyoung

Copy link
Copy Markdown
Owner

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.tsresolveContentLocale() now returns { code, name }: the code drives the UI table and the html lang attribute; the name still drives LLM prompts.
  • issueView / preview / archive / email / send render 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

  • Intentional Chinese kept: the zh-TW entries in i18n.ts, the native-name override map in locale.ts, the extension popup UI (popup.ts), and a doc example.
  • Known minor residual: issue №0's stored special title (創刊預覽號) still shows in all locales — a single edge-case UI string; can be folded into i18n.ts if 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 any console.log/error/throw.

🤖 Generated with Claude Code

howieyoung and others added 4 commits August 8, 2026 20:12
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>
@howieyoung
howieyoung merged commit 44562d0 into main Aug 8, 2026
1 check passed
@howieyoung
howieyoung deleted the feat/i18n-ui-and-english-cli branch August 8, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant