mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 16:56:22 +02:00
Replace static imports of all 5 locale JSON files with dynamic imports. Only English is bundled by default, other locales (es, hi, pt, zh) load on demand when the user switches languages. Also removes unused 'set' import from zod (line 5) that was dragging Zod surface into this module unnecessarily. Changes: - Removed static imports for es, hi, pt, zh locale files - Removed unused zod import - Added loadMessages() function for dynamic locale loading - Updated setLocale() to load messages asynchronously - Added useEffect to load non-English locale on mount if stored Benefits: - Only active locale's JSON in initial bundle (English default) - 80% reduction in locale data in initial bundle - Other locale files load on demand (~50-100KB each) - Removed unnecessary zod dependency from module - Locale switching still works seamlessly - Faster initial page load Fixes #1143 |
||
|---|---|---|
| .. | ||
| LocaleContext.tsx | ||
| platform-context.tsx | ||