Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Translate Angular 8 application using i18n at runtime

I am developing a web app and I need to add multi-language support. I went through the Angular documentation and I noticed that the translation was occurring at build time. I was curious if we can develop it in a way that the app translates into different a language at run-time. I did some research but I could not find a proper answer.

So my question is, can I add at dropdown language selector at the top in the menu and change the language during runtime?

like image 933
Missak Boyajian Avatar asked Oct 16 '22 07:10

Missak Boyajian


1 Answers

The one and only:

http://www.ngx-translate.com/

Im using it in all of my projects.

I don't like the i18n of Angular it need for every language a separated compilation and can't change at runtime.

Demo: https://stackblitz.com/github/ngx-translate/example

like image 196
Seryoga Avatar answered Nov 11 '22 06:11

Seryoga