Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Commit 30cb2c4

Browse files
committed
updating readme for 1.0
1 parent 7f34a58 commit 30cb2c4

File tree

1 file changed

+23
-29
lines changed

1 file changed

+23
-29
lines changed

README.md

+23-29
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,10 @@
22

33
In December 2012, ECMA International published the first edition of Standard ECMA-402,
44
better known as the _ECMAScript Internationalization API_. This specification provides
5-
the framework to bring long overdue localisation methods to ECMAScript implementations.
5+
the framework to bring long overdue localization methods to ECMAScript implementations.
66

7-
Google have an implementation of this API that is available in recent versions of V8
8-
and Chrome/Chromium 24 and later. Mozilla also have a working implementation in the
9-
current Firefox nightly builds.
10-
11-
`Intl.js` fills the void of availability for this API. It will provide the framework as
12-
described by the specification, so that developers can take advantage of the native API
13-
in environments that support it, or `Intl.js` for legacy or unsupporting environments.
7+
All modern browsers, except safari, have implemented his API. `Intl.js` fills the void of availability for this API. It will provide the framework as described by the specification, so that developers can take advantage of the native API
8+
in environments that support it, or `Intl.js` for legacy or unsupported environments.
149

1510
[Build Status]: https://travis-ci.org/andyearnshaw/Intl.js.svg?branch=master
1611

@@ -35,22 +30,27 @@ document.getElementById('price').textContent = nf.format(100);
3530
```
3631

3732
Ideally, you will avoid loading this library if the browser supports the
38-
built-in `Intl`. An example of conditional usage using [yepnopejs][] library
33+
built-in `Intl`. An example of conditional usage using [browserify][] or [webpack][]
3934
_might_ look like this:
4035

4136
```javascript
42-
yepnope({
43-
test : window.Intl,
44-
nope : ['path/to/intl.js'],
45-
complete: function () {
46-
var nf = new Intl.NumberFormat(undefined, {style:'currency', currency:'GBP'});
47-
document.getElementById('price').textContent = nf.format(100);
48-
}
49-
});
50-
37+
function runMyApp() {
38+
var nf = new Intl.NumberFormat(undefined, {style:'currency', currency:'GBP'});
39+
document.getElementById('price').textContent = nf.format(100);
40+
}
41+
if (!window.Intl) {
42+
require.ensure(['intl'], (require) => {
43+
window.Intl = require('intl');
44+
// locale data should be also included here...
45+
runMyApp()
46+
});
47+
} else {
48+
runMyApp()
49+
}
5150
```
5251

53-
[yepnopejs]: http://yepnopejs.com/
52+
[webpack]: https://webpack.github.io/
53+
[browserify]: http://browserify.org/
5454

5555
## Status
5656
Current progress is as follows:
@@ -113,23 +113,17 @@ to legacy (ES3) environments, and the goal of this project is to at least provid
113113
working, albeit non-compliant implementation where ES5 methods are unavailable.
114114

115115
A subset of the tests in the test suite are run in IE 8. Tests that are not passable
116-
are skipped, but these tests are mostly about ensuring built-in function behaviour.
116+
are skipped, but these tests are mostly about ensuring built-in function behavior.
117117

118118

119119
## Locale Data
120-
`Intl.js` uses the Unicode CLDR locale data, as recommended by the specification.
121-
The data is available in JSON format, or JSONP format in the [locale-data](https://github.com/andyearnshaw/Intl.js/tree/master/locale-data)
122-
folder. This has been converted from CLDR version 24 using the script and config file
123-
in the [tools](https://github.com/andyearnshaw/Intl.js/tree/master/tools) folder.
124-
125-
The main `Intl.js` file contains no locale data itself. In browser environments, the
126-
data should be provided, parsed into a JavaScript object, using the
120+
`Intl.js` uses the Unicode CLDR locale data, as recommended by the specification. The main `Intl.js` file contains no locale data itself. In browser environments, the
121+
data should be provided, passed into a JavaScript object using the
127122
`Intl.__addLocaleData()` method. In Node.js, or when using `require('intl')`, the data
128123
is automatically added to the runtime and does not need to be provided.
129124

130125
Contents of the `locale-data` directory are a modified form of the Unicode CLDR
131-
data found at http://www.unicode.org/cldr/data/. See the `LICENSE.txt` file
132-
accompanying this software for terms of use.
126+
data found at http://www.unicode.org/cldr/.
133127

134128

135129
## Contribute

0 commit comments

Comments
 (0)