-
Hi! I'm migrating my app from vue-i18n to vue-i18n-next. When I use If I convert the This warning is emitted in this line: https://github.com/intlify/vue-i18n-next/blob/fa4c22a62c7b67b222402e0d276b3b7445e1ed68/packages/vue-i18n-core/src/i18n.ts#L717 I suppose the code shouldn't be entering the Any ideas on what I'm doing wrong and how can I remote this warning? Thank you all very much! |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 8 replies
-
You can resolve warning message the by specifying |
Beta Was this translation helpful? Give feedback.
-
Thank you for taking the time to answer me and even improving the docs! In the course of the migration, the message stopped appearing all by itself. But I'll do this in case the message comes back! |
Beta Was this translation helpful? Give feedback.
-
How about the And is it possible to set Asking because I'm getting the same error but for the i18n-n component. |
Beta Was this translation helpful? Give feedback.
-
that warning about local/global scope is so annoying for developer (because you dont want to have anything in console, only logs and real errors) - I don't understand why a global config to disable this doesn't exist. just why? let people decide if they dont want to show it and show it as default. i am currently defining global scope on all places in my code, but when you use any 3rd party library like vuetify3@beta you have warnings everywhere because they dont define scopes and fallback to global is used |
Beta Was this translation helpful? Give feedback.
-
How to remove this message if I use only $t method inside components (with Options API)? |
Beta Was this translation helpful? Give feedback.
-
I think it should use Anyway, I got rid of all warnings by overriding the import { useI18n as useI18nLib, I18nT } from 'vue-i18n';
I18nT.props.scope.default = 'global';
export const useI18n = () => ({ ...useI18nLib, useScope: 'global' });
export const i18n = createI18n({
useScope: 'global',
...
}); You can ensure nobody uses the original {
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'vue-i18n',
importNames: ['useI18n'],
message: "Please import useI18n from our custom wrapper instead, e.g. 'import { useI18n } from '@/i18n';'",
},
],
},
],
}
} A global option would really be appreciated. |
Beta Was this translation helpful? Give feedback.
You can resolve warning message the by specifying
global
toscope
property oni18n-t
componentI've added docs about it
https://vue-i18n.intlify.dev/guide/advanced/component.html#scope-resolving