Commit graph

7 commits

Author SHA1 Message Date
SohamBhattacharjee2003
d5f46dd7de perf: implement dynamic locale loading and remove unused zod import
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
2026-04-08 06:39:37 +05:30
Anish Sarkar
0a26a6c5bb chore: ran linting 2026-04-07 05:55:39 +05:30
sukarxn
af5977691b perf: optimize ui components with react hooks memoization
- toggle-group.tsx: Wrap contextValue in useMemo to prevent unnecessary re-renders
- animated-tabs.tsx: Hoist constants and memoize handlers with useCallback/useMemo
- LocaleContext.tsx: Wrap setLocale in useCallback and contextValue in useMemo
- plate-editor.tsx: Memoize SaveShortcutPlugin and contextProviderValue, use useRef for stable references
2026-04-03 23:23:54 +05:30
DESKTOP-RTLN3BA\$punk
e9979dfa7d feat: added announcements 2026-02-12 16:12:45 -08:00
DESKTOP-RTLN3BA\$punk
1daa953e83 feat: add support for additional languages in LanguageSwitcher and SidebarUserProfile components 2026-02-11 00:39:01 -08:00
DESKTOP-RTLN3BA\$punk
81ddc81026 feat(removed): sub_section_writer
- Its bad and not needed.
2025-10-27 20:30:10 -07:00
Differ
f58c7e4602 feat(i18n): Add next-intl framework with full bilingual support (EN/ZH)
- Implement next-intl framework for scalable i18n
- Add complete Chinese (Simplified) localization
- Support 400+ translated strings across all pages
- Add language switcher with persistent preference
- Zero breaking changes to existing functionality

Framework additions:
- i18n routing and middleware
- LocaleContext for client-side state
- LanguageSwitcher component
- Translation files (en.json, zh.json)

Translated components:
- Homepage: Hero, features, CTA, navbar
- Auth: Login, register
- Dashboard: Main page, layout
- Connectors: Management, add page (all categories)
- Documents: Upload, manage, filters
- Settings: LLM configs, role assignments
- Onboarding: Add provider, assign roles
- Logs: Task logs viewer

Adding a new language now requires only:
1. Create messages/<locale>.json
2. Add locale to i18n/routing.ts
2025-10-26 17:18:57 +08:00