DEV Community

Nikhil Rathi
Nikhil Rathi

Posted on

Internationalization of Angular App

How to Internationalization our Angular App?
That's the question my project manager fires on me suddenly a morning and I have no idea about the implementation of Multilingual content in Angular.
As a fresher, my first response is Let me search some good npm packages for that, i'll try some and get back to you in evening.
But i found mostly packages are either difficult to understand/implement or key-value feature need default sentence as key.
So here what i finally found after going through hundreds of Github/Google/Npm pages - why don't we implement our own approach like other projects.
It takes one hour of my day and finally first sentence of App is multilingual.
Things I use: Service, JsonFile/ServerJsonResponse, Pipe with Default value handling.

GitHub logo DebuggingDev / AngularInternationlization

Internationalization of Angular App

I will upload source code shortly.

Top comments (3)

Collapse
 
rickystam profile image
Ricky Stam • Edited

Actually Angular supports i18n, you can follow a step by step guide here:
angular.io/guide/i18n

Collapse
 
debuggingdev profile image
Nikhil Rathi

Hi Ricky, i tried to follow it too. But file format and impl. of this approach is complex for just a beginner in Angular.

  1. I faced problem in generating dynamic locale files from server too.
Collapse
 
rgails profile image
Ryan Gails

I've used ngx-translate in the past. It's pretty simple to implement and you can get translation from static json files or from your DB.