Skip to content

Conversation

rbalet
Copy link
Collaborator

@rbalet rbalet commented Aug 20, 2025

Description

As we're now having multiple instance of the TranslateService, the only way to sync language across all services is through the store.

As this issue describe, when adding a new loader, and changing the lang, the parent loader isn't triggered anymore.

Cause

The loading happen inside the service, but this service is not aware of the other loaders

Proposed solution

Storing each loader inside the store, and calling it when needed.

  • New loaders map inside the store class
  • On service instantiation, add the new loader into the loaders map
  • On service destroy, remove this loader (language aren't updated as this does not seems required)
  • On language change, triggering every loaders.

Food for though

This PR is more "food for though" than a finite PR, as I'm aware following have not been solved

  • Should we empty the translation on destroy? (I think we should not)
  • Only the last compiler will be triggered, (we could also store compilers into a map and this would solve the error)
  • This triggers one huge request, and we have to await it, maybe an other way could be optimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix(provideChildTranslateService): not calling the loader when the lazy loaded module is first loaded
2 participants