You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was looking for some way to register some callback/interceptor on failed key lookup so that I could send a request to server API we have that would notify the server of the missing translation.
I didn't find any way to do this using the library functions. I could introduce custom vue filter and some wrapper method around $t method as last resort tho I wouldn't prefer that.
The text was updated successfully, but these errors were encountered:
This functionality is actually available. You need to pass a respective handler function as onTranslationNotFound property when initializing the store. You can find an example in the readme.
// with promise as return value. this will write the new value into the store,// after the promise is resolvedVue.use(vuexI18n.plugin,store,{moduleName: 'i18n',onTranslationNotFound(locale,key){returnnewPromise((resolve,reject)=>{axios.get('/api/translations/async',{locale: locale,key:key}).then((result)=>{resolve(result.data);}).catch(){reject();}})}});
I was looking for some way to register some callback/interceptor on failed key lookup so that I could send a request to server API we have that would notify the server of the missing translation.
I didn't find any way to do this using the library functions. I could introduce custom vue filter and some wrapper method around $t method as last resort tho I wouldn't prefer that.
The text was updated successfully, but these errors were encountered: