panter / vue-i18next

Internationalization for vue using the i18next i18n ecosystem.
https://panter.github.io/vue-i18next/
176 stars 47 forks source link

Make component namespace loading optional #11

Closed nicolasg-rocketleap closed 7 years ago

nicolasg-rocketleap commented 7 years ago

Right now, each time you mount a component, it tries to fetch the namespace for that component. This is fine when your resources are already loaded, but if you use a remote backend to provide these resources such as GraphQL API / XHR backend, it makes a large amount of network calls.

Please provide an option to disable that behavior. I already defined the namespaces to load while initializing i18next. The automatic component namespace loading is useless in this case and only generate errors.

Thanks!

claudiocro commented 7 years ago

Hi

Version 0.8.0 will fix this problem. 0.8.0 restores the old behavior and makes the component namespace loading optional:

const vueI18Next = new VueI18Next(i18next, {
  loadComponentNamespace: true,
});

In your case, just updating to 0.8.0 should fix your problem.