-
Hey there, I recently stumbled upon this (pretty cool looking) i18n alternative to the "normal" Nuxt i18n solution. I'll get back to the Discussion title in a moment, after a quick preface... Now then, I've been trying to look into a more optimized way of storing translations "per-component". I know that this package also supports such a use case with https://s00d.github.io/nuxt-i18n-micro/guide/per-component-translations, but I feel like maybe I got the use case wrong. First of all, this utility seems to be more intended to be used with pages, or at least that's the feeling I get when looking at the docs and the combined usage with the definition of I'd been looking for a way to get it to behave similarly to how the actual page translation files are loaded: when you are on any route, and use, for example, the provided i18n-switcher component, the other set of translation messages (like
If that makes sense? However, it seems like that function might no longer exist in the current version (1.83.0) - at least I can't seem to find it in the source code (or it's just missing in https://github.com/s00d/nuxt-i18n-micro/blob/main/src/runtime/composables/useI18n.ts). That's why I decided it could be worth asking here, for both topics:
Thanks for any answers! 👋 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello, storing translations for components in separate files is a very bad idea — each additional request will slow down the page load. Take a look at per-component-translations: https://s00d.github.io/nuxt-i18n-micro/guide/per-component-translations I'll remove the old info from the documentation. |
Beta Was this translation helpful? Give feedback.
Hello, storing translations for components in separate files is a very bad idea — each additional request will slow down the page load. Take a look at per-component-translations: https://s00d.github.io/nuxt-i18n-micro/guide/per-component-translations
I'll remove the old info from the documentation.