feat: 统一管理端多语言、配置与票据/结算页面重构
This commit is contained in:
@@ -100,15 +100,18 @@ export function applyAdminUiLocale(loc: AdminApiLocale): void {
|
||||
}
|
||||
|
||||
/** 启动时从 localStorage 恢复(应在客户端尽早调用一次) */
|
||||
export function hydrateAdminUiLocale(): void {
|
||||
export function hydrateAdminUiLocale(): AdminApiLocale | null {
|
||||
if (typeof window === "undefined") {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
const stored = readStoredUiLocale();
|
||||
if (stored) {
|
||||
setAdminRequestLocale(stored);
|
||||
document.documentElement.lang = adminHtmlLang(stored);
|
||||
return stored;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/** 供 `admin-http`:`X-Locale` + `Accept-Language` */
|
||||
|
||||
Reference in New Issue
Block a user