• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

EE/ng-l20n: An AngularJS module handling the l20n localization library.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

EE/ng-l20n

开源软件地址(OpenSource Url):

https://github.com/EE/ng-l20n

开源编程语言(OpenSource Language):

JavaScript 89.9%

开源软件介绍(OpenSource Introduction):

ng-l20n Build Status

An AngularJS module handling the l20n localization library.

ng-l20n is deprecated, switch to Project Fluent.

Usage

Usage is simple - just use a data-l20n attribute with an l20n identificator (with a stock l20n you'd use data-l10n-id instead) so tutorials from http://l20n.org still apply with this little change.

An example sandbox is included. You can freely use Angular expressions inside the attribute, they will be parsed for you before passing to l20n.

Configuration

Locale is stored in localStorage. The localStorage key as well al the $rootScope property that stores the locale are customizable:

myApp.config(['l20nProvider', function (l20nProvider) {
  l20nProvider.localeStorageKey = 'myAppLocaleKey';    // default: 'locale'
  l20nProvider.localeProperty = 'myAppLocale';         // default: none
}]);

If the localeProperty is not specified, nothing will be saved to $rootScope.

Minification and linting

Minification and linting is supported via Grunt tasks. To obtain the minified file together with the sourcemap, first install a global grunt-cli package:

npm -g install grunt-cli

Then install local npm packages:

npm install

After performing these steps, invoking:

grunt

will lint & build the files; you can copy all 3 files (ng-l20n.js, ng-l20n.min.js, ng-l20n.min.map) from the dist/ folder.

Notes

ng-l20n requires l20n.js in version 1.0 or newer.

License

The module is available under the MIT license (see MIT-LICENSE.txt for details).




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap