From 307300225bbe2928690ebc7acc9fc24bd2e1e2b4 Mon Sep 17 00:00:00 2001 From: Eugene Date: Mon, 23 Sep 2024 18:24:46 +0300 Subject: [PATCH] fix: $t function to correctly render keys from loaded namespaces (#3376) Resolves an issue where the $t function was not properly rendering translation keys from loaded namespaces. --- packages/vue/src/VueTolgee.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/vue/src/VueTolgee.ts b/packages/vue/src/VueTolgee.ts index 1559d0f17c..65bfe33d1b 100644 --- a/packages/vue/src/VueTolgee.ts +++ b/packages/vue/src/VueTolgee.ts @@ -61,6 +61,12 @@ export const VueTolgee = { ); } + reactiveContext.value.tolgee.on('cache', () => { + reactiveContext.value.tolgee = Object.freeze({ + ...reactiveContext.value.tolgee, + }); + }); + app.config.globalProperties.$t = ((...args: Parameters) => reactiveContext.value.tolgee.t(...args)) as TolgeeT;