5

How to disable console warning like this :

Not found '21.11.2021' key in 'finnish' locale messages

vue-i18n version is "9.0.0-beta.6".

I am trying silentTranslationWarn: true

const i18n = createI18n({
  messages: {
    en,
    finnish
  },
  fallbackLocale: 'en',
  silentTranslationWarn: true
});

but it doesn't work in this version. Thank you.

Penny Liu
  • 15,447
  • 5
  • 79
  • 98
Denys
  • 283
  • 2
  • 11

2 Answers2

7

Found myself during debugging i18n object.

Two options should be added:

fallbackWarn: false,
missingWarn: false
Denys
  • 283
  • 2
  • 11
-3
if (process.env.NODE_ENV === 'development') {
    require("../../mock/mock.js"); // simulation data
    console.warn = () => { }
}
ching
  • 1
  • 1
    Thank you for this code snippet, which might provide some limited, immediate help. A [proper explanation](https://meta.stackexchange.com/q/114762/9193372) would greatly improve its long-term value by showing why this is a good solution to the problem and would make it more useful to future readers with other, similar questions. Please edit your answer to add some explanation, including the assumptions you’ve made. – Syscall Mar 23 '21 at 19:09
  • Not an answer to the question. – ShadowGames Jun 29 '23 at 23:02