Closed timoransky closed 1 year ago
can you check if inside the <template>
it works? Thanks.
@xiCO2k sadly no, not even in the template as you can see here:
<template>
<div class="p-20">
{{ $t("prefix.Media") }}
</div>
</template>
Got it, thanks. Will find the issue and add a fix for that.
Thanks
Great, if you will need any help or more info from my side just hit me up anytime 😊
@xiCO2k just tried installing v1.4.4 and it works in the template:
Hey @timoransky just checked, and seems to be working, and I also created a test to make sure that works: https://github.com/xiCO2k/laravel-vue-i18n/commit/85367852f8db4e7e585a8e042d1958a6db82ab65
Also your example:
setup({ el, app, props, plugin }) {
return createApp({ render: () => h(app, props) })
.use(plugin)
.use(i18nVue, {
resolve: async (lang) => {
const langs = import.meta.glob("../../../*.json");
// This doesn't provide any output to console
console.log("foo");
return await langs[`../../../${lang}.json`]();
},
})
...
.mount(el);
},
It looks like you are not looking on a lang
folder.
Hi!
I can't get this package to work on my project for some reason. I mean, it works, but it doesn't really load translations from my .json file.
This is what my
/resources/js/admin/index.js
looks like. Notice the console log in resolve function which doesn't output anything to the console.And this is how my
/lang/en.json
looks like:However, when I try to get the translation for key
prefix.Media
I get the key back, like there is no translated string present.I'm using InertiaJS with Vite, this is my config:
Do you by any chance know where might be the problem? Or did I missunderstand something in the docs?
Thanks in advance!