I'm not sure about what you try to do....but here is what I did in order to use translations with i18n
I followed installation process from installation vue-18n and I have the followings
package.json
"dependencies": {
"vue-i18n": "^7.3.0"
}
app.js
require('./bootstrap');
// window.Vue = require('vue');
import Vue from 'vue';
import i18n from 'vue-i18n'
import { translations } from './translations.js'
Vue.use(i18n, translations);
....
const app = new Vue({
el: '#app',
translations
});
here is a translations.js file in same folder as app.js for my example
export const translations = {
'en': {
'Hello world': 'Hola Mundo',
'Next': 'Next',
'Result': 'Result'
},
'fr': {
'Hello world': 'Bonjour le monde',
'Next': 'suivante',
'Result': 'Résultat'
}
}
and here in a component how I get translation
Situation.vue
<button @click="postAnswer">{{ $t('Result', { locale: language }) }}</button>
Finally set your language in the controller for example, before to call the view containing your vue component
app()->setLocale( $language->code );
return view....
I have not changed any other file, just followed the installation process described in the file coming from the same site you mentioned, and it runs perfectly, after npm run watch
Hope that can help you.