diff --git a/src/index.js b/src/index.js index 7888cb26b..356f338bb 100644 --- a/src/index.js +++ b/src/index.js @@ -499,7 +499,7 @@ export default class VueI18n { // fallback locale if (isNull(formats) || isNull(formats[key])) { - if (process.env.NODE_ENV !== 'production') { + if (process.env.NODE_ENV !== 'production' && !this._silentTranslationWarn) { warn(`Fall back to '${fallback}' datetime formats from '${locale} datetime formats.`) } _locale = fallback @@ -533,7 +533,7 @@ export default class VueI18n { const ret: ?DateTimeFormatResult = this._localizeDateTime(value, locale, this.fallbackLocale, this._getDateTimeFormats(), key) if (this._isFallbackRoot(ret)) { - if (process.env.NODE_ENV !== 'production') { + if (process.env.NODE_ENV !== 'production' && !this._silentTranslationWarn) { warn(`Fall back to datetime localization of root: key '${key}' .`) } /* istanbul ignore if */ @@ -596,7 +596,7 @@ export default class VueI18n { // fallback locale if (isNull(formats) || isNull(formats[key])) { - if (process.env.NODE_ENV !== 'production') { + if (process.env.NODE_ENV !== 'production' && !this._silentTranslationWarn) { warn(`Fall back to '${fallback}' number formats from '${locale} number formats.`) } _locale = fallback @@ -640,7 +640,7 @@ export default class VueI18n { const ret: ?NumberFormatResult = this._localizeNumber(value, locale, this.fallbackLocale, this._getNumberFormats(), key, options) if (this._isFallbackRoot(ret)) { - if (process.env.NODE_ENV !== 'production') { + if (process.env.NODE_ENV !== 'production' && !this._silentTranslationWarn) { warn(`Fall back to number localization of root: key '${key}' .`) } /* istanbul ignore if */