Date: 2026-01-11 00:41
Summary: Fixed default-English display so / and prefixes follow SITE_DEFAULT_LANG=en.
[question] 修改系统默认为英文展示,但目前网站默认为中文
[try to solve]
Fixed Worker default-language and URL-prefix rules: default is no longer hard-coded Chinese; it follows SITE_DEFAULT_LANG (currently en). When the browser prefers Chinese, / redirects to /zh/; with no Accept-Language or English preference, / serves English. Also fixed static build and client scripts that assumed Chinese never has a prefix, then rebuilt so nav links and path prefixes match.
[actions]
- Updated:
src/index.ts - Updated:
src/pages/websiteHeadersPage.ts - Updated:
scripts/site/config.mjs - Updated:
scripts/site/layout.mjs - Ran:
env SITE_LANGS=zh,en SITE_DEFAULT_LANG=en npm run build:site