mirror of
https://github.com/zadam/trilium.git
synced 2025-10-30 19:19:03 +01:00
chore(website): fix typecheck issues
This commit is contained in:
parent
c212c5d6ff
commit
4f72f81a95
@ -9,12 +9,14 @@ interface Locale {
|
|||||||
|
|
||||||
i18next.use(initReactI18next);
|
i18next.use(initReactI18next);
|
||||||
const localeFiles = import.meta.glob("./translations/*/translation.json", { eager: true });
|
const localeFiles = import.meta.glob("./translations/*/translation.json", { eager: true });
|
||||||
const resources: Record<string, Record<string, string>> = {};
|
const resources: Record<string, Record<string, Record<string, string>>> = {};
|
||||||
for (const [ path, translations ] of Object.entries(localeFiles)) {
|
for (const [ path, _translations ] of Object.entries(localeFiles)) {
|
||||||
const id = path.split("/").at(-2);
|
const id = path.split("/").at(-2);
|
||||||
|
if (!id) continue;
|
||||||
if (!resources[id]) resources[id] = {};
|
if (!resources[id]) resources[id] = {};
|
||||||
if ("default" in (translations as any)) {
|
const translations = _translations as { default: Record<string, string> } | Record<string, string>;
|
||||||
resources[id].translation = (translations as any).default;
|
if ("default" in translations) {
|
||||||
|
resources[id].translation = translations.default as Record<string, string>;
|
||||||
} else {
|
} else {
|
||||||
resources[id].translation = translations;
|
resources[id].translation = translations;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,9 @@
|
|||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"jsxImportSource": "preact",
|
"jsxImportSource": "preact",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
|
"types": [
|
||||||
|
"vite/client"
|
||||||
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
"react": ["../../node_modules/preact/compat/"],
|
"react": ["../../node_modules/preact/compat/"],
|
||||||
"react-dom": ["../../node_modules/preact/compat/"]
|
"react-dom": ["../../node_modules/preact/compat/"]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user