Role of Angular in multilingual website
Multilingual websites are highly significant as they translate the website content into one or more foreign languages in order to better serve international audience in their local language.
Since its inception, Angular has been dominating the open source JavaScript frameworks’ landscape. Angular has a module called ng2-translate that not only offer components like services, directives, asynchronous loading of i18n but also filters and much more to translate your texts.
What is internationalization (i18n)?
Internationalization or i18n is a custom attribute of ng2 translate module that Angular tools and compilers recognize and after translation the compiler eliminates it.
The process of designing a software application in such a way that it is capable of adapting itself into various languages and regions without requiring any engineering changes is called internationalization (i18n).
Therefore, internationalization of any website via coding ensures that the same could be changed to different languages or regions along with their content.
How to internationalize your Angular web application?
Firstly initialize the ng-2 translation service in your application and then install the ng-2 translate plugin via npm.
After that you would need to add reference of TranslateModule in App Module which is by default used in TranslateStaticLoader. Otherwise you can use the custom loader for adding the reference.
Now every language has its *.json file that contains all the translations data and by default the TranslateStaticLoader searches locales files in i18n/*.json.