Skip to content

Commit

Permalink
fix: $t function to correctly render keys from loaded namespaces (#3376)
Browse files Browse the repository at this point in the history
Resolves an issue where the $t function was not properly rendering
translation keys from loaded namespaces.
  • Loading branch information
EugeneBalabai authored Sep 23, 2024
1 parent 0ec56e2 commit 3073002
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/vue/src/VueTolgee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<TolgeeT>) =>
reactiveContext.value.tolgee.t(...args)) as TolgeeT;

Expand Down

0 comments on commit 3073002

Please sign in to comment.