@@ -12,46 +12,47 @@ Dust helpers for internationalization.
12
12
### Browser
13
13
14
14
1 . Install with [ bower] ( http://bower.io/ ) : ` bower install dust-helper-intl `
15
- 2 . Load the scripts into your page. (It does not matter which order the scripts are loaded in.)
15
+ 2 . Load the scripts into your page.
16
16
17
- ``` html
18
- <script src =" dustjs-linkedin.js" ></script >
19
- <script src =" dust-helper-intl.js" ></script >
20
- ```
17
+ ``` html
18
+ <script src =" intl-messageformat.js" ></script >
19
+ <script src =" dustjs-linkedin.js" ></script >
20
+ <script src =" dust-helper-intl.js" ></script >
21
+ ```
21
22
22
23
3 . Register the helpers:
23
24
24
- ```javascript
25
- DustHelperIntl.register(dust);
26
- ```
25
+ ``` javascript
26
+ DustHelperIntl .register (dust);
27
+ ```
27
28
28
29
29
30
### Node/CommonJS
30
31
31
32
1 . You can install the helpers with npm: ` npm install dust-helper-intl `
32
33
2 . Load in the module and register it:
33
34
34
- ```javascript
35
- var Dust = require('dustjs-linkedin');
36
- global.Intl = require('intl');
37
- require('dust-helper-intl').register(Dust);
38
- ```
35
+ ``` javascript
36
+ var Dust = require (' dustjs-linkedin' );
37
+ global .Intl = require (' intl' );
38
+ require (' dust-helper-intl' ).register (Dust);
39
+ ```
39
40
40
- **NOTE:** Since node (as of 0.10) doesn't provide the global `Intl` object
41
- (ECMA-402) you'll need to provide a polyfill. The `intl` NPM package can
42
- provide this or you can use another.
41
+ ** NOTE:** Since node (as of 0.10) doesn't provide the global ` Intl ` object
42
+ (ECMA-402) you'll need to provide a polyfill. The ` intl ` NPM package can
43
+ provide this or you can use another.
43
44
44
45
45
46
### AMD
46
47
47
48
1 . Install with [ bower] ( http://bower.io/ ) : ` bower install dust-form-helpers `
48
49
3 . Load in the module and register it:
49
50
50
- ```javascript
51
- define(['dust', 'dust-helper-intl'], function(Dust, DustHelperIntl) {
52
- DustHelperIntl.register(Dust);
53
- });
54
- ```
51
+ ``` javascript
52
+ define ([' dust' , ' dust-helper-intl' ], function (Dust , DustHelperIntl ) {
53
+ DustHelperIntl .register (Dust);
54
+ });
55
+ ```
55
56
56
57
57
58
## Usage
@@ -94,7 +95,7 @@ Output:
94
95
Template:
95
96
96
97
``` js
97
- var tmpl = ' <time>{@intlDate val=' + dateStr + ' hour="numeric" minute="numeric" timeZone="UTC"/}</time>' ,
98
+ var tmpl = ' <time>{@intlDate val=' + dateStr + ' hour="numeric" minute="numeric" timeZone="UTC"/}</time>' ;
98
99
```
99
100
100
101
Output:
@@ -126,21 +127,21 @@ Output:
126
127
Template:
127
128
128
129
``` js
129
- var tmpl = ' <b>{@intlNumber val=40000.004 /}</b>' ,
130
+ var tmpl = ' <b>{@intlNumber val=40000.004 /}</b>' ;
130
131
```
131
132
132
133
Output:
133
134
134
135
``` html
135
- <b >40,000.005 </b >
136
+ <b >40,000.004 </b >
136
137
```
137
138
138
139
####Basic (de-DE)
139
140
140
141
Template:
141
142
142
143
``` js
143
- var tmpl = ' <b>{@intlNumber val=40000 locales="de-DE"/}</b>' ,
144
+ var tmpl = ' <b>{@intlNumber val=40000.004 locales="de-DE"/}</b>' ;
144
145
```
145
146
146
147
Output:
0 commit comments