Performance: Why i18n matters
MEDIUM IMPACT
Internationalization (i18n) affects page load speed and user interaction by managing language resources efficiently and avoiding unnecessary reloads or large bundles.
Use dynamic imports or Next.js middleware to load only the needed language file on demand
import all language JSON files upfront in _app.js and bundle them together
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Load all languages upfront | Low | Multiple on initial load | High due to large bundle | [X] Bad |
| Dynamic language loading | Low | Single on load | Low | [OK] Good |
| Full page reload on language switch | High | Multiple | High | [X] Bad |
| Client-side language switch | Low | Single | Low | [OK] Good |