Inconsistent Scope Resolution Between Template and Class #903
Unanswered
YannickLauzier-eaton
asked this question in
Q&A
Replies: 0 comments
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.
-
Hello everyone,
I haven’t found a clear answer yet, but please feel free to point me to existing discussions or issues if this has already been covered. 🙂
Context
We are working in an NX workspace and plan to build an application using a domain-driven architecture.
We are very optimistic about Transloco, as it allows:
Our intended workflow:
emitErrorOnExtraKeys: true.Global transloco.config.ts
Configuration from the host
Expected Behavior
Each library declares its own scope.
For example, libs/domain-a/feature-a contains a FeatureA component that provides its scope:
Observed Issues
Key Manager (TKM) behavior
For
keyFromClassto be extracted by TKM, I must explicitly specify the scope:However, this causes an unexpected side effect:
Transloco attempts to load translations from a domainAFeatureA folder inside the host application, rather than using the scope provided by
provideTranslocoScope.If I instead do:
✅ Runtime behavior is correct.
❌ But when running extraction again, the key is removed from the JSON file because of:
Using the class based key as the template key.
If we are doing the following:
We have an error during the runtime and the translations are not resolved and the key manager does not extract the key.
Questions
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions