translate back button ionic 2

前端 未结 4 1548
[愿得一人]
[愿得一人] 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:24

    In you app.module.ts:

    @NgModule({
    declarations: [
        MyApp
    ],
    imports: [
        BrowserModule,
        IonicModule.forRoot(MyApp, {
            platforms: {
                ios: {
                    backButtonText: 'Voltar'
                }
            }
        }),
    ],
    bootstrap: [IonicApp],
    entryComponents: [
        MyApp
    ],
    providers: [
        StatusBar,
        SplashScreen,
        {provide: ErrorHandler, useClass: IonicErrorHandler}
    ]})
    

提交回复
热议问题