Translation inside select options

yes i am sorry. i use translation with ngFor loop to translate the names of the pages in the side menu (ion-menu). My code is like this:

<button ion-item *ngFor="let p of pages" (click)="openPage(p)"> <ion-icon name={{p.icon}} item-left></ion-icon> {{p.title | translate}} </button>

in the app.ts:

this.pages = [ { title: 'Page1Title', icon: 'home', component: HomePage }, { title: 'Page2Title', icon: 'ios-information-circle', component: InfoPage }, { title: 'Page3Title', icon: 'mail', component: ContactPage }, { title: 'Page4Title', icon: 'paper', component: AboutPage } ];

and the json file:

{ "Page1Title": "Home", "Page2Title": "Info", "Page3Title": "Contact", "Page4Title": "About" }

i hope it helps :slight_smile:

1 Like