I'm submitting a ... (check one with "x")
[ ] bug report => check the FAQ and search github for a similar issue or PR before submitting
[ ] support request => check the FAQ and search github for a similar issue before submitting
[x] feature request
Current behavior
Actually, the translate module can't be used with Ionics 3.0 lazy loading pages (or I'm too stupid to implement that). The docs explain how to setup ngx-translate for Ionic and separately for lazy loading but no guide how to combine these two parts together.
Expected/desired behavior
Update the Docs for Ionics 3.0 lazy loading pages.
ngx-translate version: x.x.x
6.x.x
Angular version: 4.0.0
Browser: [all ]
I found a solution and updatedt also the Ionic docs.
Here is the code for all your page.module.ts files
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { TranslateModule } from '@ngx-translate/core';
import { HelloPage } from './hello-page';
@NgModule({
declarations: [
HelloPage,
],
imports: [
IonicPageModule.forChild(HelloPage),
TranslateModule.forChild()
],
exports: [
HelloPage
]
})
export class HelloPageModule {}
I will create also a PR for the Ionic 2 example in this repo
@MTechDE Thank you so much!! I was just looking for a solution to this problem today. I just tried it and can confirm it works great. Awesome!
Hi. It doesn't work for me if I try to change the language with translate.use('xx'); inside the lazy loaded module. Any ideas? Thank you
you can follow thread https://forum.ionicframework.com/t/ngx-translate-and-ionic-3/87005/24
Most helpful comment
I found a solution and updatedt also the Ionic docs.
Here is the code for all your page.module.ts files
I will create also a PR for the Ionic 2 example in this repo