在角如何根据用户的语言动态加载javascript文件 [英] in Angular How to Dynamically Load javascript file depending of user language
问题描述
我采用了棱角分明的德语,英语,西班牙语,法语和意大利语用户
如何加载本地文件动态依赖的用户的语言设置?举个例子 :
对于德语用户应角负荷:
的https://$c$c.angularjs.org /1.4.3/i18n/angular-locale_de-de.js
意大利用户应负载角
的https://$c$c.angularjs.org /1.4.3/i18n/angular-locale_it-it.js
I am using Angular for German, English, Spanish, French and Italian users How to load the local file dynamically depend of User ' Language settings ? as an example : For German users should Angular load: https://code.angularjs.org/1.4.3/i18n/angular-locale_de-de.js For Italian Users should Angular load https://code.angularjs.org/1.4.3/i18n/angular-locale_it-it.js
我想用$ local.id定义然后根据我加载本地文件的用户的语言,但我不知道如何或是否有任何其他解决方案来加载JS文件动态也是AP preciated。
问候
I am thinking to use $local.id to define the user language then based on that I load the local file , but I don't know how or if there is any other solution to load the JS file dynamically also is appreciated . regards
推荐答案
可以为它angular.translate模块。
you can the angular.translate module for it..
https://angular-translate.github.io/
这篇关于在角如何根据用户的语言动态加载javascript文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!