fix: unify chinese language code as zh-CN

This commit is contained in:
TerryM
2026-05-26 10:03:12 +08:00
parent f2e97c329e
commit f482a2ec38
13 changed files with 53 additions and 50 deletions

View File

@@ -37,7 +37,7 @@ export function AdminResourceForm() {
const [title, setTitle] = useState("");
const [description, setDescription] = useState("");
const [rtype, setRtype] = useState<string>("image");
const [language, setLanguage] = useState("zh");
const [language, setLanguage] = useState("zh-CN");
const [categoryId, setCategoryId] = useState(1);
const [coverImage, setCoverImage] = useState("");
const [fileUrl, setFileUrl] = useState("");
@@ -66,7 +66,7 @@ export function AdminResourceForm() {
setTitle(r.title || "");
setDescription(r.description || "");
setRtype(r.type || "image");
setLanguage(r.language || "zh");
setLanguage(r.language || "zh-CN");
setCategoryId(r.categoryId || 1);
setCoverImage(r.coverImage || "");
setFileUrl(r.fileUrl || "");
@@ -183,7 +183,7 @@ export function AdminResourceForm() {
value={language}
onChange={(e) => setLanguage(e.target.value)}
>
<option value="zh">{t("lang_zh")}</option>
<option value="zh-CN">{t("lang_zh_CN")}</option>
<option value="en">{t("lang_en")}</option>
<option value="ja">{t("lang_ja")}</option>
<option value="ko">{t("lang_ko")}</option>