Open BVSureshBabu opened 5 years ago
I'm trying to achieve the same, I suggest you open a question on stackoverflow to discuss there as I don't think this is an issue with the ngx-translate platform
Hi,
I am using ngx-translate with nrwl. It is working fine if I keep all translation file in app and loading all once. But I want to load translation files per lib lazily i.e whenever module loads that time I want to load translation files loaded in that lib. libs are lazyloaded. I am using below versions
"@nrwl/nx": "1.0.0", "@ngx-translate/core": "9.1.1", "@ngx-translate/http-loader": "2.0.1", "@angular/compiler-cli": "5.2.7",
Please help me to achieve this. Thanks in advance.
Thanks & Regards, Suresh
Did you find a solution for the same? I am also looking for a way to achieve the same...can you help?
Same. I am using nx
. Here's the further I have got. Still can't have the behaviour to really extend
but I think I got pretty close, evolving from other people's StackBlitz.
For lazy-loaded modules with different translation loaders (loading .json
from different files) it seems to be either (in the case of the lazy-loaded):
isolate: false
, extend: true
) React to parent module translation events automatically without having to connect anything, just as they say, but cannot load the lazy loaded specific files.isolate: true
, extend: true
) We have to propagate changes to parent's translation event changes to the lazy child ourselves, and we can have our specific translations working! But the parent's translation won't work.It's like I can't blend the two.
https://stackblitz.com/edit/translations-and-lazy-loading?file=README.md
@docwhite any updates of this?
Sadly not @vmagalhaes. I ended up learning another tool called transloco.
Sadly not @vmagalhaes. I ended up learning another tool called transloco.
And did you have a better result with lib <> app interaction?
@vmagalhaes yes you can craft it using what they call "scopes" https://ngneat.github.io/transloco/docs/lazy-load/scope-configuration/
Hi,
I am using ngx-translate with nrwl. It is working fine if I keep all translation file in app and loading all once. But I want to load translation files per lib lazily i.e whenever module loads that time I want to load translation files loaded in that lib. libs are lazyloaded. I am using below versions
Please help me to achieve this. Thanks in advance.
Thanks & Regards, Suresh