What is the best way to make Angularjs application as multilingual if using ASP.net WEB api?

问题内容:

I have worked on the application that was multilingual. We made that application in ASP.Net MVC 5 and front end was in (jquery and javascript modular pattern). We implemented localization using resource files and in cshtml files, application showed according to current culture. Now I am working on an application which is in angularJs(1.5) and ASP.net web API. I am searching for best practice to make angularjs app as multilingual. So far I found that we can use angular-translate. Also, i tried this in sample application and it is working as expected. Now is there any other best way to implement localization? Like should I make resource file on server side and then using web API I get messages according to set culture? If there is another way then Please suggest.

问题评论:

    
angular translate with asynchronous loading is the way to go angular-translate.github.io/docs/#/guide/…

答案:

答案1:

angular-translate is a third-party library to implement localization in angularJS. It allows us to create language packs with localized strings. This can only be useful if you have static content in your app, but you also need support from backend since you will be rendering some values from API which also has to be localized. You can send a header such as ‘Accept-Language’ with user’s preferred language.

Useful link – https://thebhwgroup.com/blog/2015/01/translation-localization-angularjs

答案评论:

原文地址:

https://stackoverflow.com/questions/47747411/what-is-the-best-way-to-make-angularjs-application-as-multilingual-if-using-asp

Add a Comment