From 00ad6f4877527994832b4debf764ebcc4d437c8b Mon Sep 17 00:00:00 2001 From: Eugene Date: Tue, 17 Sep 2024 16:52:05 +0300 Subject: [PATCH] remove default language, rename option name for SSR --- packages/vue/src/TolgeeProvider.ts | 4 ++-- packages/vue/src/VueTolgee.ts | 8 ++++---- testapps/vue-ssr/renderer/+onCreateApp.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/vue/src/TolgeeProvider.ts b/packages/vue/src/TolgeeProvider.ts index 7e2cdd93e7..1b391a3ba0 100644 --- a/packages/vue/src/TolgeeProvider.ts +++ b/packages/vue/src/TolgeeProvider.ts @@ -22,11 +22,11 @@ export const TolgeeProvider = defineComponent({ }, staticData: { type: Object as PropType, - default: undefined, + required: false, }, language: { type: String as PropType, - default: 'en', + required: false, }, }, diff --git a/packages/vue/src/VueTolgee.ts b/packages/vue/src/VueTolgee.ts index 3af50bf543..1559d0f17c 100644 --- a/packages/vue/src/VueTolgee.ts +++ b/packages/vue/src/VueTolgee.ts @@ -11,7 +11,7 @@ import { TolgeeVueContext } from './types'; type Options = { tolgee?: TolgeeInstance; - isSSR?: boolean; + enableSSR?: boolean; }; type TolgeeT = TolgeeInstance['t']; @@ -24,16 +24,16 @@ export const VueTolgee = { throw new Error('Tolgee instance not passed in options'); } - const isSSR = Boolean(options?.isSSR); + const isSsrEnabled = Boolean(options?.enableSSR); const reactiveContext = ref({ tolgee: tolgee, - isInitialRender: isSSR, + isInitialRender: isSsrEnabled, }); app.provide('tolgeeContext', reactiveContext); - if (isSSR) { + if (isSsrEnabled) { const getOriginalTolgeeInstance = (): TolgeeInstance => ({ ...reactiveContext.value.tolgee, t: ((...args: Parameters) => { diff --git a/testapps/vue-ssr/renderer/+onCreateApp.ts b/testapps/vue-ssr/renderer/+onCreateApp.ts index bc3696a7bf..37bc5a7c69 100644 --- a/testapps/vue-ssr/renderer/+onCreateApp.ts +++ b/testapps/vue-ssr/renderer/+onCreateApp.ts @@ -5,5 +5,5 @@ export const onCreateApp = (pageContext) => { const { app } = pageContext; const tolgee = createTolgee(); - app.use(VueTolgee, { tolgee, isSSR: true }); + app.use(VueTolgee, { tolgee, enableSSR: true }); };