Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Translate elements with ngx-translate in common.ts file

$
0
0

@apalau wrote:

Hi there,

I would like to translate elements using the ngx-translate library for ionic.
The following code works perfectly in all pages of the app, except the common.ts page

this.translate.get(['download_failed', 'was_not_successfully_downloaded']).subscribe(res => {
    const alertFailure = this.alertCtrl.create({
        title: res.download_failed,
        subTitle: res.was_not_successfully_downloaded,
        buttons: ['OK']
    });
    alertFailure.present();
});

I guess that the library is called after the common.ts file.

Any idea to use translation into common.ts ?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>