Skip to content

Commit

Permalink
⚡ improvement(extend): disable no translation warning when set missin…
Browse files Browse the repository at this point in the history
…gHandler

Closes #96
  • Loading branch information
kazupon committed Dec 8, 2016
1 parent 3590f6d commit 168a97c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/extend.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,14 @@ export default function (Vue) {

function warnDefault (lang, key, vm, result) {
if (!isNil(result)) { return result }
if (process.env.NODE_ENV !== 'production') {
warn('Cannot translate the value of keypath "' + key + '". '
+ 'Use the value of keypath as default')
if (Vue.config.missingHandler) {
Vue.config.missingHandler.apply(null, [lang, key, vm])
} else {
if (process.env.NODE_ENV !== 'production') {
warn('Cannot translate the value of keypath "' + key + '". '
+ 'Use the value of keypath as default')
}
}
Vue.config.missingHandler && Vue.config.missingHandler.apply(null, [lang, key, vm])
return key
}

Expand Down

0 comments on commit 168a97c

Please sign in to comment.