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.
DebuggingDev / AngularInternationlization
Internationalization of Angular App
I will upload source code shortly.
Top comments (3)
Actually Angular supports i18n, you can follow a step by step guide here:
angular.io/guide/i18n
Hi Ricky, i tried to follow it too. But file format and impl. of this approach is complex for just a beginner in Angular.
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.