This commit is contained in:
eric
2026-03-09 05:07:59 -05:00
parent 302a072036
commit eb852fb11d
27 changed files with 1523 additions and 169 deletions

View File

@@ -0,0 +1,17 @@
"use client";
import { useEffect } from "react";
import { useLocale } from "@/i18n/navigation";
/**
* 根据当前 locale 设置 document.documentElement.lang以支持无障碍与 SEO
*/
export default function SetLangAttr() {
const locale = useLocale();
useEffect(() => {
document.documentElement.lang = locale === "zh" ? "zh-CN" : "en";
}, [locale]);
return null;
}