Ngx-translate: outputs key instead of translated string

Have same problem as in the first post. In my case problem was in packages version. Latest version of ngx-translate don’t use http service. For me all works fine with

"@ngx-translate/core": "7.0.0"
"@ngx-translate/http-loader": "0.1.0"

For me it sometimes works and sometime, without any change of code, doesn’t work and prints the keys. So, there is apparently something wrong with timing.

Any updates about this issue?

Had the same problem: ngx-translate wasn’t working in pages that were lazily loaded.

I got it working by calling this method in the lazily loaded components module->imports:
TranslateModule.forChild()

before I was trying to import the Translate module just like in the app.module.ts but that was a wrong approach.

I found the answer to this issue on the ionics docs page for this plugin:
[https://ionicframework.com/docs/developer-resources/ng2-translate/]

sidemenu Is the problem solved?

{{'HOME.TITLE '| translate }}

Try like this.

For child modules with lazy loading you need also to register

TranslateModule.forChild({
      loader: {
          provide: TranslateLoader,
          useFactory: HttpLoaderFactory,
          deps: [HttpClient]
      }