question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Disable no translation warning

See original GitHub issue

vue-i18n logs the following as a warning whenever a translation is not found:

[vue-i18n] Cannot translate the value of keypath "Mobile". Use the value of keypath as default

This can be convenient for debugging, but I have certain cases that it is legitimate to not find a translation and I would not like a warning to be logged. In my product we have created components that use the translation internally, and expect a message code to normally be passed in. A good example of this is the Select component we have created. It uses the $t function to translate all of the options. In some uses of the Select component, the options are not message codes because they have been created by the user. It is not desirable to spam the console with a bunch of warnings.

I believe a reasonable approach would be to have a configuration option to disable the warning, or to not log the warning if a missingHandler is registered in the config.

Vue.config.disableNoTranslationWarning = true;

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:13
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

179reactions
ahalimkaracommented, Sep 30, 2017

In case of someone need it:

new VueI18n({
  locale,
  messages,
  silentTranslationWarn: true
})
11reactions
TomaszAdamowiczcommented, Jun 22, 2022

It is not working with Vue3 app

I suppose you are using v.9.x, you should pass to config following options :  missingWarn: false, fallbackWarn: false,

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change/disable the missing translation warnings - Drupal
I have drupal 7.15 site with default Croatian language translated to English as well. I'm using Entity translation module (7.x-1.0-alpha2) for ...
Read more >
Disable automatic translation warning - Zendesk help
Hello - Is there any update on this? Prior to ability to customise the translation it is possible to remove this warning? I...
Read more >
How to disable angular-translation warning? - Stack Overflow
I'm getting all translation related warning in browser console, so i want to suppress/disable all related warning (Dont show to user) ...
Read more >
Microsoft Edge - Turn off translate prompt for known languages
Microsoft Edge - Turn off translate prompt for known languages ... Go to edge://settings/languages and disable 'Offer to translate pages ...
Read more >
How to completely disable website translation - Mozilla Support
I don't need any translation when a website is either in french, english or spanish. No translation at all. hence, I'd like to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found