fix: map chinese language requests to zh-CN

This commit is contained in:
TerryM
2026-05-26 08:09:20 +08:00
parent e7a5952d58
commit f2e97c329e
7 changed files with 14 additions and 11 deletions

View File

@@ -10,7 +10,7 @@ import {
} from "../components/LatestUpdateRow";
import { RecommendedCard } from "../components/RecommendedCard";
import { SectionHeader } from "../components/SectionHeader";
import { useI18n } from "../i18n";
import { langQuery, useI18n } from "../i18n";
import { categoryCardLines } from "../utils/categoryDisplay";
export function Home() {
@@ -23,7 +23,7 @@ export function Home() {
const [canScrollRec, setCanScrollRec] = useState(false);
useEffect(() => {
const q = `?lang=${encodeURIComponent(lang)}`;
const q = `?lang=${encodeURIComponent(langQuery(lang))}`;
Promise.all([
getJSON<Category[]>(`/api/categories${q}`),
getJSON<{ items: Resource[] }>(`/api/resources/recommended${q}&limit=12`),