Open 7nohe opened 1 year ago
I would love to review a PR with that capabilities.
@daniser do you think this is solved?
Thanks
@daniser do you think this is solved?
Thanks
No unfortunately(
I will leave this here if someone wants to contribute. Thanks @daniser 💪
@xiCO2k ,
Am I correct to understand that this plugin does not support TS for the moment?
Many thanks.
@mathiasselleslach, it should support, but probably missing some typing.
Thanks @xiCO2k .
Using a Laravel/Vue(3)/Inertia setup myself and cant' get it to work. I am in a Typescript setup.
App.ts (as per documentation)
.use(i18nVue, {
resolve: async (lang: string) => {
const langs: any = import.meta.glob("../../lang/*.json");
return await langs[`../../lang/${lang}.json`]();
}
})
vite.config.js
export default defineConfig({
plugins: [
laravel({
input: 'resources/js/app.ts',
refresh: true,
}),
vue({
template: {
transformAssetUrls: {
base: null,
includeAbsolute: false,
},
},
}),
i18n(),
],
});
Am i missing something here?
When rendering
$t('test')
It just defaults to the key in the en.json file (yes, locale is set to en ;-) that i have checked)
I am interested in having type-safe resources support like Vue I18n. Is it possible to achieve this?
https://vue-i18n.intlify.dev/guide/advanced/typescript.html