Break out translation importing into its own function for load{Locale,Namespace}Async #384
jesperp
started this conversation in
DX improvements
Replies: 2 comments 3 replies
-
|
Thanks for your suggestion. Indeed it makes sense to expose a function to just load a dictionary. I can add this feature |
Beta Was this translation helpful? Give feedback.
3 replies
-
|
shipped in version |
Beta Was this translation helpful? Give feedback.
0 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Right now,
loadLocaleAsyncandloadNamespaceAsyncimports translations and loads them into theloadedLocalesdictionary. I would like to break out the importing of the translation into a separate exported function that bothloadLocaleAsyncandloadNamespaceAsynccan reuse. This opens up the possibility to get the translations without updating the globally sharedloadedLocales, which can be problematic in a server environment (see discussions here).This is untested possible solution (I am sure Ivan can clean this up):
I think this is quite a simple structural change that doesn't break anything but opens up a possible solution for users that can't use the singleton dictionary. Sure, I can just do
"generateOnlyTypes": trueand make my own solution but then I loose a lot of the benefits like automatically updating my namespace imports. I think users wants to go great lengths to avoid generateOnlyTypes, unless doing a lot of custom stuff..Thoughts? :)
Beta Was this translation helpful? Give feedback.
All reactions