0

I am building an Ionic2 app and trying to use ng2-translate for localization. I followed https://ionicframework.com/docs/v2/resources/ng2-translate/ this tutorial.

However it gives me some compilation errors as follows:

enter image description here

because of these app can not start. What's going wrong?

Thinker
  • 5,326
  • 13
  • 61
  • 137

2 Answers2

1

Change import { TranslateModule } from 'ng2-translate/ng2-translate'; to import { TranslateModule, TranslateLoader, TranslateStaticLoader } from 'ng2-translate/ng2-translate'.

ranakrunal9
  • 13,320
  • 3
  • 42
  • 43
0

The issue was incomplete imports which aren't mentioned in the tutorial I followed!

import { TranslateModule, TranslateStaticLoader } from 'ng2-translate/ng2-translate';
import {TranslateLoader} from 'ng2-translate';

this solved the problem. I refereed (TranslateModule and TranslationPipe is not working anymore in Angular2 Final)

Community
  • 1
  • 1
Thinker
  • 5,326
  • 13
  • 61
  • 137