feat: game strings api

This commit is contained in:
TrèsAbhi committed 2026-01-13 13:18:55 -06:00
1 parent a2d0d2d8c0
commit 2d282a3261
3 files changed
+83 -18

No files matched your search

@@ -0,0 +1,25 @@
import locales from "@blitzkit/i18n/locales.json";
import type { GetStaticPaths, GetStaticPathsResult } from "astro";
import { api } from "../../../../core/api/dynamic";
export const getStaticPaths = (async () => {
const paths: GetStaticPathsResult = [];
const groups = await api.gameStringGroups();
for (const { locale } of locales.supported) {
for (const group of groups) {
paths.push({ params: { locale, group } });
}
}
return paths;
}) satisfies GetStaticPaths;
export async function GET({
params,
}: {
params: { locale: string; group: string };
}) {
const strings = await api.groupedGameStrings(params.locale, params.group);
return Response.json(strings);
}