Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
robisim74 committed Jul 1, 2016
1 parent d64e928 commit edd587e
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,50 @@
[![npm version](https://badge.fury.io/js/angular2localization.svg)](https://badge.fury.io/js/angular2localization)
> An Angular 2 library to translate messages, dates and numbers.
This library is developed using [TypeScript](https://www.typescriptlang.org/) and [Angular 2](https://angular.io/) for i18n and l10n of Angular 2 applications.
This library is developed using TypeScript and Angular 2 for i18n and l10n of Angular 2 applications.
It allows, in addition to translation, to localize numbers and dates of your app, adding language code, country code, and optionally script code, numbering system and calendar, through [Internationalization API](https://developer.mozilla.org/it/docs/Web/JavaScript/Reference/Global_Objects/Intl). It also implements the validation of numbers by locales.
Because it is only a branch of Angular 2, the goal is the complete integration with the native solutions of Angular 2.

[Sample app](http://robisim74.github.io/angular2localization) built with Angular 2 Material & webpack, and its [source code](https://github.com/robisim74/angular2localization/tree/gh-pages).
**[Sample app](http://robisim74.github.io/angular2localization)** built with Angular 2 Material & webpack, and its [source code](https://github.com/robisim74/angular2localization/tree/gh-pages).

Get the changelog by [releases](https://github.com/robisim74/angular2localization/releases).

Compatible with Angular 2.0.0-rc.3
Compatible with **Angular 2.0.0-rc.4**

## Installing
You can add `angular2localization` to your project via [Node and npm](https://nodejs.org):
You can add `angular2localization` to your project using `npm`:
```
npm install --save angular2localization
```

### Loading via SystemJS
To load the package you have two methods using [SystemJS](https://github.com/systemjs/systemjs):
- Loading the bundle:
```JavaScript
<script src="node_modules/angular2localization/bundles/angular2localization.js"></script>
```
- Using SystemJS configuration:
## Loading
#### Using SystemJS configuration
```JavaScript
var map = {
'app': 'app',
...
'angular2localization': 'node_modules/angular2localization'
'angular2localization': 'node_modules'
};

var packages = {
'app': { format: 'cjs', main: 'main.js', defaultExtension: 'js' },
...
'angular2localization': { format: 'cjs', defaultExtension: 'js' }
'angular2localization/angular2localization': { main: '/bundles/angular2localization.umd.min.js', defaultExtension: 'js' }
};
```

### Loading via webpack
If you consume the library via [webpack](https://webpack.github.io/), simply import the library in your `vendor` file after Angular 2 imports:
#### Via webpack
Import the library in your `vendor` file after Angular 2 imports:
```TypeScript
import 'angular2localization/angular2localization';
```

#### Plain JavaScript
If you build apps in Angular 2 using plain JavaScript, you can include the `umd` bundle in your `index.html`:
```Html
<script src="node_modules/angular2localization/bundles/angular2localization.umd.min.js"></script>
```

## Usage
See [library specification](https://github.com/robisim74/angular2localization/blob/master/doc/spec.md).

Expand All @@ -53,17 +54,17 @@ See [library specification](https://github.com/robisim74/angular2localization/bl

## Building
In order to build the library if you want to contribute:
```
```Shell
npm install
typings install
npm run build
```
To test locally the npm package:
```
npm pack
```Shell
npm pack ./dist
```
Then you can install it in your app to test it:
```
```Shell
npm install [path]angular2localization-[version].tgz
```

Expand Down

0 comments on commit edd587e

Please sign in to comment.