I'm trying to display a notification based on a value returned by the server. I don't know how to retrieve the translation value dynamically using the value of the key just received.
For example, the value of error.response.data.errorDetailsCode is "invalid_credentials", and the translation is "Invalid credentials provided"
import i18n from './i18n';
$.notify({message: i18n.t("error.response.data.errorDetailsCode")}, options);
I get this warning on the console:
vue-i18n.esm.js?a925:14 [vue-i18n] Cannot translate the value of keypath 'invalid_credentials'. Use the value of keypath as default.