Reference link: https://vue-i18n.intlify.dev/guide/essentials/scope.html#local-scope-2
const i18n = createI18n({
locale,
default: 'zh-CN',
messages: {
'en-US': en,
'zh-CN': cn
}
})
i18n.global.locale = 'en-US'
After importing the i18n you created, you can change the language by modifying i18n.global.locale. It’s really super simple.