mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 11:39:01 +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); | ||||
| 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; | ||||
|     } | ||||
|  | ||||
| @ -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/"] | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran