You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which Transloco package(s) will this feature affect?
Transloco, Scoped Libs, Don't know / other
Is your feature request related to a problem? Please describe
We have a nx workspace and each feature library has translation files.. but I need to be able to override some of the features translations based on app.
Describe the solution you'd like
In the app routes I would like to use a custom loader that fetches the translations from a api and applies them when the feature is loaded.
but no matter how I try I end up with this: Type '() => InlineLoader' is not assignable to type 'InlineLoader'. Index signature for type 'string' is missing in type '() => InlineLoader'.
Describe alternatives you've considered
ngx-translate, angular native i18n
Additional context
No response
I would like to make a pull request for this feature
Yes 🚀
The text was updated successfully, but these errors were encountered:
mackelito
changed the title
Feature(scope):
Feature(scope): Dynamically load and apply translations in app.routes
Oct 17, 2023
@mackelito you may have missed a part of the type of your loader function. The inline loader's type is actually an alias for another type, HashMap<() => Promise<Translation>>. Your error is telling you that the index part of the Hash<T> type is missing, so your loader function should return either HashMap<() => Promise<Translation>> or its alias, InlineLoader.
Is there an existing issue for this?
Which Transloco package(s) will this feature affect?
Transloco, Scoped Libs, Don't know / other
Is your feature request related to a problem? Please describe
We have a nx workspace and each feature library has translation files.. but I need to be able to override some of the features translations based on app.
Describe the solution you'd like
In the app routes I would like to use a custom loader that fetches the translations from a api and applies them when the feature is loaded.
Perhaps something like this...
but no matter how I try I end up with this:
Type '() => InlineLoader' is not assignable to type 'InlineLoader'. Index signature for type 'string' is missing in type '() => InlineLoader'.
Describe alternatives you've considered
Additional context
No response
I would like to make a pull request for this feature
Yes 🚀
The text was updated successfully, but these errors were encountered: