Bolt: Optimize LanguageProvider initialization #63

Closed
ragusa-it wants to merge 1 commits from bolt-optimize-language-provider-4624894025953684601 into main

1 Commits

Author SHA1 Message Date
google-labs-jules[bot]
2691a66327 Bolt: Optimize LanguageProvider initialization
💡 What: Optimized `LanguageProvider` to use lazy state initialization for `language` and removed `isInitialized` state.
🎯 Why: The previous implementation triggered a second render on mount because it initialized state to 'de' and then updated it in a `useEffect`.
📊 Impact: Reduces initial render count of the entire application by 50% (from 2 to 1).
🔬 Measurement: Verified with `src/i18n/__tests__/initialRender.test.tsx` which confirms the render count is now 1.

Co-authored-by: ragusa-it <196988693+ragusa-it@users.noreply.github.com>
2026-02-07 01:52:37 +00:00