docs: UI-02 acceptance record and visual verification

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-21 23:10:58 +08:00
parent 160e7e5f1a
commit 2a489aa16a
23 changed files with 297 additions and 75 deletions
+10 -1
View File
@@ -11,8 +11,17 @@ function isSupported(value: string): value is ViewerLocale {
return (SUPPORTED_LOCALES as readonly string[]).includes(value);
}
// 持久化优先(localStorage),其次浏览器语言(zh*/en 前缀),兜底 zh-CN。
// 分享链接 ?lang= 参数优先(V05 §5.4:相册/照片分享 URL 携带语言,接收端
// 据此呈现——不持久化,接收者未做选择;显式切换仍走 LocaleSwitcher 落盘),
// 其次持久化(localStorage),再次浏览器语言(zh*/en 前缀),兜底 zh-CN。
// 嵌入 iframe 的 lang 查询(zh-CN/en/auto)语义在 embed/feed.ts 独立解析,
// 此处仅认 zh-CN/en——auto/非法值自然落入既有解析链,EmbedPage 加载后仍会
// 按相册 defaultLocale 覆盖,互不冲突。
function resolveInitialLocale(): ViewerLocale {
if (typeof window !== 'undefined') {
const param = new URLSearchParams(window.location.search).get('lang');
if (param !== null && isSupported(param)) return param;
}
try {
const stored = localStorage.getItem(LOCALE_STORAGE_KEY);
if (stored !== null && isSupported(stored)) return stored;