I have made a third-party Vue library that has its own i18n (I export it to be used in app.use() for another Vue web app). This library is being used inside a Nuxt3 app. However, there seems to be a conflict between the i18n of Nuxt and the Vue library. I tried to define a plugin as follows:
import { i18n } from "@my-library"
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(i18n);
});
The Vue library translation works fine, but the translation inside Nuxt breaks. When I comment out the code nuxtApp.vueApp.use(i18n);, the Nuxt translation works fine, but the library only shows translation keys.
i18n from Vue Library:
const i18n = createI18n({
legacy: false,
allowComposition: false,
locale: "en",
globalInjection: true,
});
How do I make sure that both work well without breaking the other?