fix(docs): browser changelog respects lang instead of falling back to GitHub

This commit is contained in:
t8y2 2026-07-06 22:59:50 +08:00
parent 23c36343b0
commit 75fcd253cb
1 changed files with 2 additions and 4 deletions

View File

@ -55,10 +55,8 @@ export function changelogUrl(lang: "en" | "cn") {
}
export async function fetchChangelog(lang: "en" | "cn"): Promise<ChangelogData> {
if (typeof window !== "undefined") {
return fetchGitHubChangelog();
}
// 浏览器端同样优先走 R2 的翻译版 JSON英文版由 sync-changelog 翻译生成);
// 之前客户端直接 fallback 到 GitHub 原文(中文),会导致英文页面 hydrate 后被中文覆盖。
const url = changelogUrl(lang);
try {