From 57b15dba7580c4043cdabcc38e283a3bf3da420d Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Wed, 10 Nov 2021 19:30:25 +0900 Subject: [PATCH] improvement: vue-i18n-bridge installation at nuxt-bridge --- packages/vue-i18n-core/src/i18n.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/vue-i18n-core/src/i18n.ts b/packages/vue-i18n-core/src/i18n.ts index 67763963c..efe244a37 100644 --- a/packages/vue-i18n-core/src/i18n.ts +++ b/packages/vue-i18n-core/src/i18n.ts @@ -830,7 +830,10 @@ function getI18nInstance(instance: ComponentInternalInstance): I18n { if (vm == null) { throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR) } - const i18n = (vm as any)._i18nBridgeRoot // eslint-disable-line @typescript-eslint/no-explicit-any + let i18n = (vm as any)._i18nBridgeRoot // eslint-disable-line @typescript-eslint/no-explicit-any + if (!i18n) { + i18n = _legacyI18n + } /* istanbul ignore if */ if (!i18n) { throw createI18nError(I18nErrorCodes.NOT_INSLALLED)