You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 3, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,7 @@
10
10
npm install messageformat-loader
11
11
```
12
12
13
-
You'll also need another loader (like [json-loader](https://github.com/webpack/json-loader)) to actually load the JSON strings
14
-
15
-
```
16
-
npm install json-loader
17
-
```
13
+
You'll also need another loader (like [json-loader](https://github.com/webpack/json-loader) or [multi-json-loader](https://github.com/cletusw/multi-json-loader)) to actually load the JSON strings
18
14
19
15
## Usage
20
16
@@ -37,11 +33,15 @@ npm install json-loader
37
33
### example.js
38
34
39
35
```javascript
40
-
var messages =require('messageformat!json!./messages.json');
36
+
var messages =require('messageformat?locale=en!json!./messages.json');
41
37
messages['ordinal-example']({ N:1 });
42
38
// => 'The 1st message.'
43
39
```
44
40
41
+
## Options (passed as [query parameters](http://webpack.github.io/docs/using-loaders.html#query-parameters))
42
+
43
+
*`locale` The [CLDR language code](http://www.unicode.org/cldr/charts/29/supplemental/language_territory_information.html) to pass to [messageformat.js](https://messageformat.github.io/messageformat.js/doc/MessageFormat.html). Defaults to `en`.
0 commit comments