You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs for getRouteNamespaces imply that it only returns the namespaces for the current request, however we are finding it returns every namespace in our app.
This causes the server to load a lot more namespaces from an http backend than necessary to serve the current request which impacts performance.
Perhaps it should use the current route matches instead of all routeModules instead,
Create a Remix app with many separate localization namespaces.
Note that all namespaces are returned by getRouteNamespaces for each request.
**letns=i18next.getRouteNamespaces(remixContext);**awaitinstance.use(initReactI18next)// Tell our instance to use react-i18next.use(Backend)// Setup our backend.init({
...i18n,// spread the configuration
lng,// The locale we detected above
ns,// The namespaces the routes about to render wants to usebackend: {loadPath: resolve("./public/locales/{{lng}}/{{ns}}.json")},});
Expected behavior
As a developer, I expect only the namespaces required for the current matched routes to be returned.
Screenshots or Videos
No response
Platform
NodeJS 20+
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
The docs for getRouteNamespaces imply that it only returns the namespaces for the current request, however we are finding it returns every namespace in our app.
This causes the server to load a lot more namespaces from an http backend than necessary to serve the current request which impacts performance.
Perhaps it should use the current route
matches
instead of allrouteModules
instead,e.g.
Your Example Website or App
Can create if necessary.
Steps to Reproduce the Bug or Issue
getRouteNamespaces
for each request.Expected behavior
As a developer, I expect only the namespaces required for the current matched routes to be returned.
Screenshots or Videos
No response
Platform
NodeJS 20+
Additional context
No response
The text was updated successfully, but these errors were encountered: