Where are the AngularJS I18n files?

岁酱吖の 提交于 2020-01-13 07:33:45

问题


They talk about locale-specific files here http://docs.angularjs.org/guide/i18n but don't mention where to get them (the official AngularJS repo doesn't contain them).

So where does one obtain these locale files?


回答1:


You can also get them with bower:

bower install angular-i18n

It is the official bower distribution that mirrors the files at https://code.angularjs.org/

More info at https://github.com/angular/bower-angular-i18n




回答2:


Lastest stable version i18n files at here: http://code.angularjs.org/1.0.3/i18n/

You can also find other versions at here: http://code.angularjs.org/




回答3:


You can also get them with npm:

npm install angular-i18n

And then add the locale-File of your choice in your index.html:

<script src="/node_modules/angular-i18n/angular-locale_YOUR-LOCALE.js"></script>

Note that only the latest loaded locale-file will be used by your angular app.

It is also possible to change the locale dynamically with angular-dynamic-locale. Then you don't need to decide on startup in the index.html which locale you want to use.




回答4:


First install all files from bower

bower install angular-i18n --save

or get angular-locale files for your required language-country from https://github.com/angular/bower-angular-i18n

then either do hard work and include all files in head in your script tags or just download

tmhDynamicLocale js

(smart work), it dynamically include all angular-locale files.

Follow this git hub repository for demo

https://github.com/ajarvis98/angular-locale-tmh-dynamic-locale

Follow the structure exactly as in this git-repo



来源:https://stackoverflow.com/questions/14270405/where-are-the-angularjs-i18n-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!