@a7mdFo2ad wrote:
hi
I wanna to make my app remember the selected language even he closed the app and open it again
html<ion-item class="settings-items" no-border ion-item> <ion-icon class="img-view" item-start name="ios-globe"> </ion-icon> <ion-label [ngClass]="(this.Platform.isRTL ) ? 'settings-textAr': 'settings-text' ">{{'LANG' | translate:param}}</ion-label> <ion-select mode="ios" [(ngModel)]="lang" item-end (ionChange)="switchLanguage()"> <ion-option class="options" value="en"> {{'ENG' | translate:param}} </ion-option> <ion-option class="options" value="ar"> {{'ARAB' | translate:param}} </ion-option> </ion-select> </ion-item>ts
switchLanguage() { if (this.lang === 'en') { this.translate.use(this.lang) this.Platform.setDir('ltr', true) } else { this.Platform.setDir('rtl', true) this.translate.use(this.lang); } }
Posts: 2
Participants: 2