tolgee-js
tolgee-js copied to clipboard
Dynamic staticData not loaded automatically in Vue integration
Describe the bug
When using staticData with a function returning a Promise (dynamic import) in Vue 3, the translations are not loaded automatically. In React, the same approach works as expected.
To Reproduce
import { createApp } from "vue";
import App from "./App.vue";
import { Tolgee, DevTools, FormatSimple, VueTolgee } from "@tolgee/vue";
const tolgee = Tolgee()
.use(DevTools())
.use(FormatSimple())
.init({
language: "de",
staticData: {
de: () => import('./shared/translates.json'),
},
});
const app = createApp(App);
app.use(VueTolgee, { tolgee });
app.mount("#app");
Expected behavior Tolgee should automatically load the dynamic JSON and make the translations available in Vue components, similar to the React integration.
Additional context
- Vue 3.5.19
- @tolgee/vue 6.2.7