Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Ionic Cookbook

You're reading from   Ionic Cookbook Recipes to create cutting-edge, real-time hybrid mobile apps with Ionic

Arrow left icon
Product type Paperback
Published in Apr 2018
Publisher
ISBN-13 9781788623230
Length 390 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
 Singh Singh
Author Profile Icon Singh
Singh
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Title Page
Packt Upsell
Contributors
Preface
1. Creating Our First App with Ionic FREE CHAPTER 2. Adding Ionic Components 3. Extending Ionic with Angular Building Blocks 4. Validating Forms and Making HTTP Requests 5. Adding Animation 6. User Authentication and Push Notifications 7. Supporting Device Functionalities Using Ionic Native 8. Theming the App 9. Advanced Topics 10. Publishing the App for Different Platforms 1. Other Books You May Enjoy Index

Internationalization (i18n) using ngx-translate


Having English as the primary language for your application is good. However, chances are that there are people who don't know English who may use your application. It's good to have multiple languages for using application. This is called as internationalization of application. In this part, we will use the ngx-translate library of Angular to implement the multiple language features in the Ionic application.

This is what the app looks like:

Getting ready

You can run this application inside the browser.

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.jsonfile inside the /src/assets/i18nfolder and add the following content:
{
  "Hello": "Hello",
  ...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime
Visually different images