Architecture details of the Razzle SSR implementation
masterThe Razzle SSR example demonstrates several advanced i18next patterns for Server-Side Rendering (SSR):
- Translation Hydration: Translations are passed from the server to the client during the initial render. This prevents translation reloads and UI flickering.
- Request-Scoped i18next Instances: It uses
i18next-http-middlewareon the server to ensure every request receives its own unique instance of i18next. This prevents race conditions where one user's language settings might override another user's settings in a singleton. - Client-Side Translation Serving: Uses Express to serve translations to the client side.
- Missing Translation Support: Fully supports the
saveMissingfeature of i18next. When content is missing, it is pushed to the server and stored inxyz.missing.json.