I have a json file filled with tranlations I am trying to use those translation.
First this is how I am trying to call the translation.
import messages from './i18n/messages.json
export default {
...
methods:{
data: {
messages
},
loginUser() {
if(login){
this.messages('LOGIN_SUCCESS')
}
}
}
}
But in order to do this, I don't know how to make this.messages('TOKEN')
work.
I never worked on translation code so I am asking if you just the list of translation (messages.json) file, how would you retrieve data from it to show the text?