Description
Reporting a bug
By default when fallbacking fail, two warnings are printed
e.g
[intlify] Fall back to translate 'bf.headerBar.homeSearchBarPlaceholder' key with 'en' locale
[intlify] Not found 'bf.headerBar.homeSearchBarPlaceholder' key in 'en' locale messages.
The documentation clearly state:
To suppress these warnings (while keeping those which warn of the total absence of translation for the given key) set silentTranslationWarn: true, and silentFallbackWarn: true when initializing the createI18n.
Since the failing fallback warnings are much too noisy, I want to silence them, but keep other i18n warnings.
Unfortunately, it seems that those booleans have been silently renamed and the documentation no longer reflect the state of V9
Apparently silentFallbackWarn has become fallbackWarn and the boolean logic reversed. If so why not I don't care and indeed setting fallbackWarn remove half of the warnings.
silentTranslationWarn seems to now longer exist ? (at least in non-legacy mode), however I cannot find the new boolean.
It should have been renamed to translationWarn to be consistent with fallbackWarn renaming but there is no such thing.
The ComposerOptions type expose the following candidates:
- missingWarn: when enabled it effectively hide warnings, but it hide too much warnings e.g I have no key in the fallback languages nor in the user locale.
This is in direct contradiction with
while keeping those which warn of the total absence of translation for the given key
- missing: this boolean might be the new silentTranslationWarn ? weird cause the type is not a boolean despite what the doc claims, I have no idea how to set missing.
I am on the latest stable Vue-i18n 9.1.x release.
const i18n = createI18n({
fallbackWarn: false,
missingWarn: false,
fallbackLocale: ["en", "fr"],
globalInjection: true,
legacy: false,
useScope: "global",
locale: locale,
messages: loadTranslations(),
datetimeFormats,
numberFormats,
});
edit:
the doc confirm that silentTranslationWarn has been renamed to missingWarn.
Then how come I have now warning when no key is found for fallbackLocale?
@kazupon friendly ping
Validations
- Read the Contributing Guidelines
- Read the Documentation
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion