5

I am looking to implement a run-time locale switch in my Angular 2 app. I found the following Angular2 i18n language switch which contains a solution that uses SystemJS, https://plnkr.co/edit/JyE4l4TjEruuPsrbanmK. My app uses webpack. I am trying to use the raw-loader to load my xlf file but am getting "Error: cannot find module ./i18n/messages.es.xlf." I think the problem may be related to this chunk of code in the i18n-providers.ts file.

declare var System: any;

function getTranslationsWithSystemJs(file: string) {
  return System.import(file); // relies on text plugin
}

What do I replace the preceding code with if using webpack?

Community
  • 1
  • 1
Paul D.
  • 157
  • 2
  • 3
  • 6

0 Answers0