How to do it...

The following are the instructions to do it:

  1. Create a new TranslateApp using the blank template and navigate inside the folder, as follows:
$ ionic start TranslateApp blank$ cd TranslateApp
  1. Install ngx-translate/core and ngx-translate/http-loader, as follows:
npm install @ngx-translate/core @ngx-translate/http-loader --save
  1. Create the en.json file inside the /src/assets/i18n folder and add the following content:
{  "Hello": "Hello",  "Good Morning": "Good Morning"}
  1. Create the de.json file inside the /src/assets/i18n folder and add the following content:
{  "Hello": "Hallo",  "Good Morning": "Guten Morgen"}
  1. Open /src/pages/home/home.html and update it as follows:
<ion-header>  <ion-navbar>    <ion-title>      Ionic Language </ion-title> ...

Get Ionic Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.