Closed chris-hud closed 1 year ago
Hi, I am unable to retrieve nested json. It seems similar to this closed issue here but I don't understand the resolution https://github.com/xiCO2k/laravel-vue-i18n/issues/130
Using laravel, with vue, inertia, vite
en.json
{ "dashboard": "Your Name", "sidebar": { "one": "this should print" } }
app.js
return createApp({ render: () => h(App, props) }) .use(i18nVue, { resolve: async lang => { const langs = import.meta.glob('../../lang/*.json'); return await langs[`../../lang/${lang}.json`](); } }) ...
The imported file (from network tab) looks like this
export const dashboard = "Your Name"; export const sidebar = { one: "this should print" }; export default { dashboard: dashboard, sidebar: sidebar };
Plugin working successfully for non-nested data.
{{$t("dashboard")}} prints Your Name
{{$t("sidebar.one")}} prints sidebar.one
That is not supposed to work. I don't think Laravel does that with the .json translations.
.json
Hi, I am unable to retrieve nested json. It seems similar to this closed issue here but I don't understand the resolution https://github.com/xiCO2k/laravel-vue-i18n/issues/130
Using laravel, with vue, inertia, vite
en.json
app.js
The imported file (from network tab) looks like this
Plugin working successfully for non-nested data.