-
-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable no translation warning #96
Comments
Thank you for your feedback. |
@kazupon Thanks! |
In case of someone need it: new VueI18n({
locale,
messages,
silentTranslationWarn: true
}) |
I am first time user of i18n on Vue cli/ui and looked for that as well. Most of my logic is data driven, so nearly all my buttons, labels, hints, errors, tooltips are generated from data and they are not handled with the report. |
+1 for some sort of hook where i can check wether i want to display the warning or not. I have an usecase where there's a check for a translation which 60% wont exist. I would like to silence that specific warning however I would still like to receive warnings on different use cases. |
this not working in vue3 |
I haven't verified it in detail yet, but it doesn't seem to work in my vue3 app. |
It is not working with Vue3 app |
I suppose you are using |
"Not Found" warnings are now gone, but "Fall back" warnings remain when I don't have them in all language objects.
|
Can I use smth like this only once in the template? I.e. don't change global warn settings but use it when I get data from the server and I don't have every key. |
vue-i18n logs the following as a warning whenever a translation is not found:
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.The text was updated successfully, but these errors were encountered: