translate back button ionic 2

前端 未结 4 1547
[愿得一人]
[愿得一人] 2021-02-14 19:39

I changed the name of the Back button in ionic 2 but does somebody know how you can translate this button with ng2-translate?

this.config.set(\'backButtonText\',         


        
4条回答
  •  青春惊慌失措
    2021-02-14 20:19

    I had to use it like this (in app.component.ts)

    this.platform.ready().then(() => {
      this.translate.get('GENERIC.BACK').subscribe(backLabel => {
        this.config.set('ios', 'backButtonText', backLabel);
      });
    });

提交回复
热议问题