Skip to content

Commit 18a0f6f

Browse files
authored
improvement: vue-i18n-bridge installation at nuxt-bridge (#780)
1 parent 1f85082 commit 18a0f6f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/vue-i18n-core/src/i18n.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,10 @@ function getI18nInstance(instance: ComponentInternalInstance): I18n {
830830
if (vm == null) {
831831
throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR)
832832
}
833-
const i18n = (vm as any)._i18nBridgeRoot // eslint-disable-line @typescript-eslint/no-explicit-any
833+
let i18n = (vm as any)._i18nBridgeRoot // eslint-disable-line @typescript-eslint/no-explicit-any
834+
if (!i18n) {
835+
i18n = _legacyI18n
836+
}
834837
/* istanbul ignore if */
835838
if (!i18n) {
836839
throw createI18nError(I18nErrorCodes.NOT_INSLALLED)

0 commit comments

Comments
 (0)