Change back button label by language


In my ionic app I have menu with back-button.
The text of back button is configured by IonicModule.forRoot:

 imports: [
    backButtonIcon: 'arrow-forward',
    backButtonText: 'back',
    tabsPlacement: 'top',

At my app I have button for change language and I want to translate the back-button according to the selected language.
But how can I have access for app configuration in simple function at any angular-2 component?


I think those setting are at the module level so every page in your app will have the same value of back button, since the module has access to all the components and services - see if you can set the language value in a service variable and try to see it on the module as

backButtonText: ServiceName.staticLanguageProperty

I havent tried it but you can give it a try.

Let us know if it works.


You can use the ViewController to change the back button text.

Be sure to insert the call in ionViewWillEnter or later.

ionViewWillEnter() {
  this.translateService.get('Back').subscribe(text => {