chore(website): fix typecheck issues

This commit is contained in:
Elian Doran 2025-10-27 18:19:35 +02:00
parent c212c5d6ff
commit 4f72f81a95
No known key found for this signature in database
2 changed files with 9 additions and 4 deletions

View File

@ -9,12 +9,14 @@ interface Locale {
i18next.use(initReactI18next);
const localeFiles = import.meta.glob("./translations/*/translation.json", { eager: true });
const resources: Record<string, Record<string, string>> = {};
for (const [ path, translations ] of Object.entries(localeFiles)) {
const resources: Record<string, Record<string, Record<string, string>>> = {};
for (const [ path, _translations ] of Object.entries(localeFiles)) {
const id = path.split("/").at(-2);
if (!id) continue;
if (!resources[id]) resources[id] = {};
if ("default" in (translations as any)) {
resources[id].translation = (translations as any).default;
const translations = _translations as { default: Record<string, string> } | Record<string, string>;
if ("default" in translations) {
resources[id].translation = translations.default as Record<string, string>;
} else {
resources[id].translation = translations;
}

View File

@ -9,6 +9,9 @@
"jsx": "react-jsx",
"jsxImportSource": "preact",
"skipLibCheck": true,
"types": [
"vite/client"
],
"paths": {
"react": ["../../node_modules/preact/compat/"],
"react-dom": ["../../node_modules/preact/compat/"]