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
Angular allows for the use of factory providers, which represents a function that returns a specific token. These function can have other providers as arguments which get provided via the deps property of the factory provider.
When TranslocoService is provided as such argument and the translate function is invoked with a key, the translation manager do not find this key. This does also happen when the translation key is a static string. Additionally, it does not matter whether the TranslocoPipe or the TranslocoService is used in the same component.
Expected behavior
As a developer I expect the transloco key manager to find keys that are defined in factory providers.
Please provide a link to a minimal reproduction of the bug
This should not be relevant, but can be seen in the debug log.
Debug Logs
Note
It is true that the key APP_NAME_INLINE is also missing in the configuration, but it serves as a verification that the tool is working in the targeted component.
The key I expect to show up is APP_NAME_FROM_FACTORY.
Is there an existing issue for this?
Is this a regression?
No
Current behavior
Angular allows for the use of factory providers, which represents a function that returns a specific token. These function can have other providers as arguments which get provided via the
deps
property of the factory provider.When
TranslocoService
is provided as such argument and thetranslate
function is invoked with a key, the translation manager do not find this key. This does also happen when the translation key is a static string. Additionally, it does not matter whether theTranslocoPipe
or theTranslocoService
is used in the same component.Expected behavior
As a developer I expect the transloco key manager to find keys that are defined in factory providers.
Please provide a link to a minimal reproduction of the bug
https://stackblitz.com/edit/transloco-missing-key-detection-factory-provider?file=src%2Fmain.ts
Transloco Config
Debug Logs
Note
It is true that the key
APP_NAME_INLINE
is also missing in the configuration, but it serves as a verification that the tool is working in the targeted component.The key I expect to show up is
APP_NAME_FROM_FACTORY
.Please provide the environment you discovered this bug in
Additional context
I can provide a PR pull likely need guidance since I'm unfamiliar with the projects internal code base.
I would like to make a pull request for this bug
Yes 🚀
The text was updated successfully, but these errors were encountered: