@swez_k yeah found this and implemented everything seems to be working except the changes are not reflected due to the app is mounted once and it does not mount every time on local changes so the changes are not reflected..
On first load everything is working based on the default lang but when i chnage default lang to the hi ref value is changed and watch also runs and call the getLocal and set it within vue and laravel as well confirmed that..
but not loading the changes due to the already mounted app.
Any suggestion or help.
my code
App.js code
import './bootstrap';
import { createApp, onUpdated, watch } from 'vue'
import { createPinia } from 'pinia';
import router from "./routes/index.js";
import HomeView from './views/HomeView.vue';
import App from './App.vue';
// import Home from './components/Home.vue';
import { i18nVue } from 'laravel-vue-i18n';
import useLocalizationStore from './store/localizationStore.js';
const app = createApp(App);
app.use(createPinia())
const language = useLocalizationStore();
console.log(`php_${language.lang}`);
app.use(i18nVue, {
lang: `php_${language.lang}`,
// lang : 'php_hi',
resolve: async lang => {
const langs = import.meta.glob('../../lang/*.json');
return await langs[`../../lang/${lang}.json`]();
}
})
app.use(router)
app.mount('#app');