Automatically load all necessary namespaces when switching the locale in typesafe-i18n/vue #535
nkoehring
started this conversation in
Show and tell
Replies: 2 comments 1 reply
-
|
Looks good! I did something similar in a recent |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Good idea! Feel free to use the code any way you like. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The following GIST contains a composable for Vue3, that triggers loading of all namespaces given in the route meta information. This allows abstracting the locale namespaces out of the component into the page definition. It also triggers reload on locale change, which otherwise would have to be reimplemented inside each component that uses namespaces.
https://gist.github.com/nkoehring/08531494ef97d0d36fb82630c2481e5e
Please let me know in case there is already a better way to do this.
Beta Was this translation helpful? Give feedback.
All reactions