SlideShare a Scribd company logo
How to Implement
Internationalization (i18n)
in Angular
Application(Multiple
Language Support with
Example)
www.bacancytechnology.com
I am writing this blog to get you through
one of the easier ways to implement multi-
language support in Angular application,
and if you follow all the instructions that I
am going to discuss in this blog post, then I
am pretty sure that you will have your own
multi-language support Angular
application.
Table of contents:-
(1) What is Internationalization or i18n in
Angular Application?
 (2) What is multi-language support work in
Angular application?
 (3) How to implement Internationalization
in Angular Application?
 (4) Source code of Git repository.
➤ So Internationalization or i18 is a feature
that is provided by the Angular team to
support multi-languages on a website. 
➤ By using Internationalization, users can
change the language and can understand
more about the website content in a
supportive language. 
➤ For more information, you can visit
official
website https://angular.io/guide/i18n
(1) What is
Internationalization or
i18n in Angular
Application?
➤ Multiple language support is to offer
support for different languages on a website
or web page.
 ➤ By which users can change the language,
and some content will be changed based on
language preference.
(2) What is Multi-Language
Support Work in Angular
Application?
➤ Let’s do some practice with the new
Angular project, so before finishing this
blog, you will have a good multi-language
support application ready. 
➤ So first of all, let’s create a new project. 
➤ Here I am using Angular version 9.
(3) How to implement
Internationalization in
Angular Application?
➤ Create a new Angular project by the
below command.
ng new i18n – – routing
➤ Now go to the root folder and run this
project and check on localhost:4200 in a
browser
cd i18n
ng serve -o
So let’s start with creating components and
set routing with a nice bootstrap header for
redirection to the different pages.
Go to the terminal and create 3 components
ng g c profile
ng g c blog
ng g c certificate
It will create 3 components with HTML,
CSS, spec and ts files.
Now go to the app-routing.module.ts file
and set the routing as shown in the below
image.
Now create a good bootstrap header in
app.component.html and app.component.ts
file like, below image.
Note: – I have used bootstrap CDN for some
design purpose, so you need to add CDN in
index.html file or to use package.json as per
your choice, or you can use your own CSS
for the header.
And now, if you run this project, then its
output is something like the below image.
I hope your Angular project is running
without any error, so now we can start to
implement internalization in this project.
So in this project, we are going to add 3
languages support, which are English,
Hindi, and Gujarati, and for that, we need to
create 3 JSON files that refer to those
languages, and then we will use that file in
our project for language support.
So first, go to the assets folder which is
inside the src/assets and create 1 folder
named i18n and inside that create a 3
language JSON file with some key-value
pair as I show in the images below…
(1) English.json
(2) Hindi.json
(3) Gujarati.json
Now we need to install 2 dependencies by
using the below command.
npm install @ngx-translate/core @ngx-
translate/http-loader
So now we need to use TranslateModule,
TranslateLoader from @ngx-translate/core,
and TranslateHttpLoader from @ngx-
translate/HTTP-loader in app.module.ts for
configuration of the language-translation.
As I show in the below image, we need to
create a
function “createTranslateLoader” and need
to add in an import array as well for
configuration of the language JSON files,
which we created earlier.
How to implement internationalization (i18n) in angular application(multiple language support with example
As we are using HTTP so we will be required
to import HttpClientModule as well in the
app.module.ts file, as shown in the above
image.
Now we are almost ready to show the
different languages.
First, we need to set the default language in
a constructor of app.component.ts file as
shown in the below image.
-> this.translate.use(‘English’);
Now select the different languages we need
to set in a translation.
We need to create a method and set it to the
dropdown language select in
app.component.html and app.component.ts
file just like below image
Now the central part comes into the picture.
Where precisely, we want to show the
different languages we need to use a
translation pipe, just like in the image
below.
In the above image, you can see that we
replace Profile to {{‘header.profile’ |
translate}}, so basically header and profile is
a key in the language JSON file like.
So if we want to show “Welcome to the
profile page.” then we need to do something
like.
So now we are done with internalization or
i18n or Multi-language support in our
Angular project.
You can save all the changes and run this
project on the browser, and you will see the
changes.
Output Video link:-
https://drive.google.com/file/d/1kUmjbv6B
xeapvn2Qx0MEBL5XWF5xjXRy/view?
usp=sharing
Github:- https://github.com/parthsardhara/
NG-Internationalization-i18n
Project Setup:-
⦿ Clone this project using the below
command. 
⦾git clone 
https://github.com/parthsardhara/NG-
Internationalization-i18n.git
 ⦿Go to the project root folder. 
⦾ cd NG-Internationalization-i18n 
⦿Install node modules dependency by 
⦾ npm install 
⦿Run this project by 
⦾ ng serve or ng s 
⦿ Go to the browser and check on
localhost:4200
(4) Source code of Git
repository.
I hope you have enjoyed reading this blog
post. If you are looking for a helping hand to
build Angular application with
Internationalization (I18N) or looking for
support with your existing app, then get in
touch with us to integrate skilled and
seasoned Angular developers into your
existing team. We are a top-rated Angular
appliaction development company, offering
the best Angular development services and
also let you hire dedicated Angular
application developers at your convenience
engagement model.
Wrapping Up
Thank You

More Related Content

PPTX
React workshop presentation
PDF
React Router: React Meetup XXL
PDF
Angular Observables & RxJS Introduction
PPTX
React js programming concept
PDF
Introduction to React JS
PDF
Important React Hooks
PDF
ReactJS presentation
PPTX
Intro to React
React workshop presentation
React Router: React Meetup XXL
Angular Observables & RxJS Introduction
React js programming concept
Introduction to React JS
Important React Hooks
ReactJS presentation
Intro to React

What's hot (20)

PDF
Angular - Chapter 7 - HTTP Services
PDF
An introduction to React.js
PDF
React new features and intro to Hooks
PPTX
Reactjs
PPTX
Redux workshop
PDF
introduction to Vue.js 3
PDF
Basics of React Hooks.pptx.pdf
PPTX
PPTX
Angular 2.0 forms
PDF
Vue.js for beginners
PDF
JavaScript Fetch API
PDF
Why Vue.js?
PDF
Introduction to ReactJS
PDF
Introduction to Redux
PDF
React Js Simplified
PPTX
React hooks
PPTX
React hooks
PPTX
Introduction to angular with a simple but complete project
PPTX
React-JS.pptx
Angular - Chapter 7 - HTTP Services
An introduction to React.js
React new features and intro to Hooks
Reactjs
Redux workshop
introduction to Vue.js 3
Basics of React Hooks.pptx.pdf
Angular 2.0 forms
Vue.js for beginners
JavaScript Fetch API
Why Vue.js?
Introduction to ReactJS
Introduction to Redux
React Js Simplified
React hooks
React hooks
Introduction to angular with a simple but complete project
React-JS.pptx
Ad

Similar to How to implement internationalization (i18n) in angular application(multiple language support with example (20)

PPTX
PPTX
How Does Angular Work?
PPT
Oracle User Productiviy Kit
PPTX
Web application development process
PDF
Angular Interview Questions-PDF.pdf
PDF
Introduction To Angular 4 - J2I
PPTX
Internship Presentation 1 Web Developer
PDF
Progressive Web Application by Citytech
PPTX
UQ21CA642BA1-Unit-3-WAF-Class18-Introduction to Angular Routing.pptx
PDF
Diving deep in compose.pdf
PPTX
Automatic documentation with mule
PDF
Angular version 10 is here check out the new features, notable changes, depr...
PPTX
presentaion.pptx
PPTX
Basic iOS Training with SWIFT - Part 4
PDF
Progressive Web Apps - deep dive
DOCX
PPTX
#ATAGTR2019 Presentation "iOS App Automation, GitHub and Jenkins integration"...
PPT
Eo gaddis java_chapter_14_5e
PPT
Eo gaddis java_chapter_14_5e
PPTX
Angular_I18N.pptx
How Does Angular Work?
Oracle User Productiviy Kit
Web application development process
Angular Interview Questions-PDF.pdf
Introduction To Angular 4 - J2I
Internship Presentation 1 Web Developer
Progressive Web Application by Citytech
UQ21CA642BA1-Unit-3-WAF-Class18-Introduction to Angular Routing.pptx
Diving deep in compose.pdf
Automatic documentation with mule
Angular version 10 is here check out the new features, notable changes, depr...
presentaion.pptx
Basic iOS Training with SWIFT - Part 4
Progressive Web Apps - deep dive
#ATAGTR2019 Presentation "iOS App Automation, GitHub and Jenkins integration"...
Eo gaddis java_chapter_14_5e
Eo gaddis java_chapter_14_5e
Angular_I18N.pptx
Ad

More from Katy Slemon (20)

PDF
React Alternatives Frameworks- Lightweight Javascript Libraries.pdf
PDF
Data Science Use Cases in Retail & Healthcare Industries.pdf
PDF
How Much Does It Cost To Hire Golang Developer.pdf
PDF
What’s New in Flutter 3.pdf
PDF
Why Use Ruby On Rails.pdf
PDF
How Much Does It Cost To Hire Full Stack Developer In 2022.pdf
PDF
How to Implement Middleware Pipeline in VueJS.pdf
PDF
How to Build Laravel Package Using Composer.pdf
PDF
Sure Shot Ways To Improve And Scale Your Node js Performance.pdf
PDF
How to Develop Slack Bot Using Golang.pdf
PDF
IoT Based Battery Management System in Electric Vehicles.pdf
PDF
Understanding Flexbox Layout in React Native.pdf
PDF
The Ultimate Guide to Laravel Performance Optimization in 2022.pdf
PDF
New Features in iOS 15 and Swift 5.5.pdf
PDF
How to Hire & Manage Dedicated Team For Your Next Product Development.pdf
PDF
Choose the Right Battery Management System for Lithium Ion Batteries.pdf
PDF
Flutter Performance Tuning Best Practices From the Pros.pdf
PDF
Angular Universal How to Build Angular SEO Friendly App.pdf
PDF
How to Set Up and Send Mails Using SendGrid in NodeJs App.pdf
PDF
Ruby On Rails Performance Tuning Guide.pdf
React Alternatives Frameworks- Lightweight Javascript Libraries.pdf
Data Science Use Cases in Retail & Healthcare Industries.pdf
How Much Does It Cost To Hire Golang Developer.pdf
What’s New in Flutter 3.pdf
Why Use Ruby On Rails.pdf
How Much Does It Cost To Hire Full Stack Developer In 2022.pdf
How to Implement Middleware Pipeline in VueJS.pdf
How to Build Laravel Package Using Composer.pdf
Sure Shot Ways To Improve And Scale Your Node js Performance.pdf
How to Develop Slack Bot Using Golang.pdf
IoT Based Battery Management System in Electric Vehicles.pdf
Understanding Flexbox Layout in React Native.pdf
The Ultimate Guide to Laravel Performance Optimization in 2022.pdf
New Features in iOS 15 and Swift 5.5.pdf
How to Hire & Manage Dedicated Team For Your Next Product Development.pdf
Choose the Right Battery Management System for Lithium Ion Batteries.pdf
Flutter Performance Tuning Best Practices From the Pros.pdf
Angular Universal How to Build Angular SEO Friendly App.pdf
How to Set Up and Send Mails Using SendGrid in NodeJs App.pdf
Ruby On Rails Performance Tuning Guide.pdf

Recently uploaded (20)

PDF
Chapter 2 Digital Image Fundamentals.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
PDF
Modernizing your data center with Dell and AMD
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
Transforming Manufacturing operations through Intelligent Integrations
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
Chapter 2 Digital Image Fundamentals.pdf
Review of recent advances in non-invasive hemoglobin estimation
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
Modernizing your data center with Dell and AMD
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Transforming Manufacturing operations through Intelligent Integrations
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Empathic Computing: Creating Shared Understanding
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Understanding_Digital_Forensics_Presentation.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
20250228 LYD VKU AI Blended-Learning.pptx
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Per capita expenditure prediction using model stacking based on satellite ima...
NewMind AI Weekly Chronicles - August'25 Week I
GamePlan Trading System Review: Professional Trader's Honest Take

How to implement internationalization (i18n) in angular application(multiple language support with example

  • 1. How to Implement Internationalization (i18n) in Angular Application(Multiple Language Support with Example) www.bacancytechnology.com
  • 2. I am writing this blog to get you through one of the easier ways to implement multi- language support in Angular application, and if you follow all the instructions that I am going to discuss in this blog post, then I am pretty sure that you will have your own multi-language support Angular application. Table of contents:- (1) What is Internationalization or i18n in Angular Application?  (2) What is multi-language support work in Angular application?  (3) How to implement Internationalization in Angular Application?  (4) Source code of Git repository.
  • 3. ➤ So Internationalization or i18 is a feature that is provided by the Angular team to support multi-languages on a website.  ➤ By using Internationalization, users can change the language and can understand more about the website content in a supportive language.  ➤ For more information, you can visit official website https://angular.io/guide/i18n (1) What is Internationalization or i18n in Angular Application?
  • 4. ➤ Multiple language support is to offer support for different languages on a website or web page.  ➤ By which users can change the language, and some content will be changed based on language preference. (2) What is Multi-Language Support Work in Angular Application?
  • 5. ➤ Let’s do some practice with the new Angular project, so before finishing this blog, you will have a good multi-language support application ready.  ➤ So first of all, let’s create a new project.  ➤ Here I am using Angular version 9. (3) How to implement Internationalization in Angular Application?
  • 6. ➤ Create a new Angular project by the below command. ng new i18n – – routing ➤ Now go to the root folder and run this project and check on localhost:4200 in a browser cd i18n ng serve -o
  • 7. So let’s start with creating components and set routing with a nice bootstrap header for redirection to the different pages. Go to the terminal and create 3 components ng g c profile ng g c blog ng g c certificate It will create 3 components with HTML, CSS, spec and ts files. Now go to the app-routing.module.ts file and set the routing as shown in the below image.
  • 8. Now create a good bootstrap header in app.component.html and app.component.ts file like, below image.
  • 9. Note: – I have used bootstrap CDN for some design purpose, so you need to add CDN in index.html file or to use package.json as per your choice, or you can use your own CSS for the header.
  • 10. And now, if you run this project, then its output is something like the below image.
  • 11. I hope your Angular project is running without any error, so now we can start to implement internalization in this project. So in this project, we are going to add 3 languages support, which are English, Hindi, and Gujarati, and for that, we need to create 3 JSON files that refer to those languages, and then we will use that file in our project for language support. So first, go to the assets folder which is inside the src/assets and create 1 folder named i18n and inside that create a 3 language JSON file with some key-value pair as I show in the images below…
  • 15. Now we need to install 2 dependencies by using the below command. npm install @ngx-translate/core @ngx- translate/http-loader So now we need to use TranslateModule, TranslateLoader from @ngx-translate/core, and TranslateHttpLoader from @ngx- translate/HTTP-loader in app.module.ts for configuration of the language-translation. As I show in the below image, we need to create a function “createTranslateLoader” and need to add in an import array as well for configuration of the language JSON files, which we created earlier.
  • 17. As we are using HTTP so we will be required to import HttpClientModule as well in the app.module.ts file, as shown in the above image. Now we are almost ready to show the different languages. First, we need to set the default language in a constructor of app.component.ts file as shown in the below image. -> this.translate.use(‘English’);
  • 18. Now select the different languages we need to set in a translation. We need to create a method and set it to the dropdown language select in app.component.html and app.component.ts file just like below image
  • 19. Now the central part comes into the picture. Where precisely, we want to show the different languages we need to use a translation pipe, just like in the image below.
  • 20. In the above image, you can see that we replace Profile to {{‘header.profile’ | translate}}, so basically header and profile is a key in the language JSON file like.
  • 21. So if we want to show “Welcome to the profile page.” then we need to do something like. So now we are done with internalization or i18n or Multi-language support in our Angular project. You can save all the changes and run this project on the browser, and you will see the changes. Output Video link:- https://drive.google.com/file/d/1kUmjbv6B xeapvn2Qx0MEBL5XWF5xjXRy/view? usp=sharing
  • 22. Github:- https://github.com/parthsardhara/ NG-Internationalization-i18n Project Setup:- ⦿ Clone this project using the below command.  ⦾git clone  https://github.com/parthsardhara/NG- Internationalization-i18n.git  ⦿Go to the project root folder.  ⦾ cd NG-Internationalization-i18n  ⦿Install node modules dependency by  ⦾ npm install  ⦿Run this project by  ⦾ ng serve or ng s  ⦿ Go to the browser and check on localhost:4200 (4) Source code of Git repository.
  • 23. I hope you have enjoyed reading this blog post. If you are looking for a helping hand to build Angular application with Internationalization (I18N) or looking for support with your existing app, then get in touch with us to integrate skilled and seasoned Angular developers into your existing team. We are a top-rated Angular appliaction development company, offering the best Angular development services and also let you hire dedicated Angular application developers at your convenience engagement model. Wrapping Up