For projects created by vue-cli4, internationalization is supported using Vue add I18N. When the children component and parent component contain SFC I18N tags at the same time, the language of the children component cannot be correctly switched to the current language when switching the language in the parent component
Expected behavior
When switching languages, subcomponents can correctly respond to language changes
Reproduction
Detail and reappear
Vue-cli:
version: @vue/cli 4.5.13
vue-cli-plugin-i18n@2.1.3
added 14 packages from 11 contributors in 10.442s
91 packages are looking for funding
run npm fund for details
✔ Successfully installed plugin: vue-cli-plugin-i18n
? The locale of project localization. en
? The fallback locale of project localization. en
? The directory where store localization messages of project. It's stored under src directory. locales
? Enable locale messages in Single file components ? Yes
Reporting a bug?
For projects created by vue-cli4, internationalization is supported using Vue add I18N. When the children component and parent component contain SFC I18N tags at the same time, the language of the children component cannot be correctly switched to the current language when switching the language in the parent component
Expected behavior
When switching languages, subcomponents can correctly respond to language changes
Reproduction
Detail and reappear Vue-cli: version: @vue/cli 4.5.13
Step: 1、Vue create i18n-demo 2、vue add i18n Options:
📦 Installing vue-cli-plugin-i18n...
91 packages are looking for funding run
npm fund
for details✔ Successfully installed plugin: vue-cli-plugin-i18n ? The locale of project localization. en ? The fallback locale of project localization. en ? The directory where store localization messages of project. It's stored under
src
directory. locales ? Enable locale messages in Single file components ? Yes🚀 Invoking generator for vue-cli-plugin-i18n...
Vue.config.js: module.exports = { pluginOptions: { i18n: { locale: "en", fallbackLocale: "en", localeDir: "locales", enableInSFC: true, }, }, }; parent compoent:
children component:
{{ $t("hello") }}
System Info
Screenshot
Additional context
No response
Validations