-
-
Notifications
You must be signed in to change notification settings - Fork 860
Disable warnings for fallback to root locale #139
Comments
Any thoughts on this @kazupon? 🤔 -- Edit Hmmm, seems like the |
In case of someone need it new VueI18n({
locale,
messages,
silentTranslationWarn: true
}) |
Based on the description of If there was a way to specify that the translation should come from the root, it might be a good way to confirm it's being done purposefully, but it might end up making things too verbose. |
In my opinion, if If |
Considering what @jsfeldman suggests
a possibility could be to implement something like the "lazy" lookup of rails i18n, and decide that component based translations should always start with a Personally, I'm on @AlexandreMagro 's opinion: there should be a way to configure |
Hey @kazupon, would you consider re-opening this issue based on @AlexandreMagro 's suggestion? I do want to be warned when a translation is missing but right now it's impossible to see it in the middle of all the "Fall back with root locale" warnings. |
Any news or workarounds on this issue? It makes it pretty much insane to use this feature and the fix should probably be trivial to implement. |
What about indtroducing another option, like Then warnings like [vue-i18n] Value of key 'path.to.translation' is not a string!
[vue-i18n] Fall back to translate the keypath 'path.to.translation' with 'en-US' locale.
// OR
[vue-i18n] Fall back to translate the keypath 'path.to.translation' with root locale. would appear only if It would help more than silencing all translation warnings since it shows if there is really no translation provided. I think I could submit a PR. |
I think new option to suppress warning increase complexity. |
While developing, the output generated by this plugin is extensive and fills up the console. This makes developing harder as the output of other elements gets lost between all the warnings from vue-i18n. I would only like to see the plugin warn me if no translation is found at all, but not for an intended fallback. |
@exoego I cannot really imagine a situation when adding new logic to a code does not increase its complexity :-) By the way, there is no warning in production, it is already part of the code, in if (process.env.NODE_ENV !== 'production'/* && ... */) {
warn(/* ... */)
} And in development there is a possibility to silent all translation warnings ( What would be more welcome, however, is the possibility to silent warnings for intentional fallback and keep them for when there is really no translation at all (typos, missing paths...) If by 'increasing complexity' you mean that we should be able to handle this with the existing option What do you think about it? |
* feature(option): add silentFallbackWarn to VueI18n constructor * silence fallback warnings * warn only if no translation is found at all
@SzNagyMisu
I feel that improvement is necessary for that. Maybe, I'll plan to provide VSCode extension, or API. |
@SzNagyMisu |
* ⚡ improvement(option): silentFallbackWarn (#139) * feature(option): add silentFallbackWarn to VueI18n constructor * silence fallback warnings * warn only if no translation is found at all * adding typescript property declaration * 📝 docs(options): document silentFallbackWarn * Update vuepress/api/README.md Co-Authored-By: SzNagyMisu <[email protected]> * ⚡ improvement(option): silentFallbackWarn * include case when pathRet is not null, undefined, array, plain object or string * provide test case
For anyone wondering it might be worth mentioning that PR #510 adds a new option, new VueI18n({
locale,
messages,
silentFallbackWarn: true
}) |
Is there a plan to release a version? |
vue & vue-i18n version
2.2.6, 6.0.0
Steps to reproduce
Use the example for component locales
What is Expected?
No warning in developer console
What is actually happening?
My use case for component locales is as follows:
Right now I get warnings whenever I use a global locale. They go away when compiling for production, but it is still annoying as it interrupts the development process. Can you please provide a way to disable these warnings?
The text was updated successfully, but these errors were encountered: