0

Hi I have an angular 2 project internationalized with ng2-translate, it works fine but in all my module I have imported translatemodule ecc... So now the app call selectedLanguage.json in every page clicked. Is there a way to charge the translation only at the application start? And maybe to import module only in the root module?

Alessandro Celeghin
  • 4,039
  • 14
  • 49
  • 95

1 Answers1

1

You problem is most likely that you are importing ng2-translate in a module for every component. So each component has it's own copy of ng2-translate and each instance is fetching the translations. I would suggests only importing ng2-translate at your root module(app.module.ts) so that you only have one copy shared across your application.

cmaynard
  • 2,852
  • 2
  • 24
  • 34