1
 <ion-item>
    <ion-label >{{ 'branch' | translate }}</ion-label>
    <ion-select [(ngModel)]="defualtBranch"  
    okText="{{ 'okText' | translate }}"
    cancelText="{{ 'cancelText' | translate }}" 
    [selectOptions]="{{ 'selectOptionsBranch' | translate }}"  >
      <ion-option *ngFor="let branch of branchs; let i=index" value="{{branch.BranchCode}}">
        {{branch.BranchName}}
      </ion-option>
    </ion-select>
  </ion-item>

How to use selectOptions multi-lang?

Don't work this line [selectOptions]="{{ 'selectOptionsBranch' | translate }}"

Ahmad Aghazadeh
  • 16,571
  • 12
  • 101
  • 98

1 Answers1

0

In html change [selectOptions]="{{ 'selectOptionsBranch' | translate }}" to [selectOptions]="selectOptionsBranch":

In Typescript use this code :

import { TranslateService } from 'ng2-translate';
export class IntroPage {
  selectOptionsBranch:any;
  constructor(public navCtrl: NavController,translate: TranslateService) {
    translate.use("fa");
    translate.get('selectOptionsBranch').subscribe(
      value => {
        console.log(value);
        this.selectOptionsBranch = value;
      }
    )
  }
}
Ahmad Aghazadeh
  • 16,571
  • 12
  • 101
  • 98