2
2
3
3
[ ![ Build Status] ( https://travis-ci.org/benkeen/country-region-data.svg?branch=master )] ( https://travis-ci.org/benkeen/country-region-data )
4
4
5
- ### About
5
+ This repo contains a static JSON file of country names, country short codes, country regions, and country region short
6
+ codes. All country names and short codes are guaranteed to be unique. Similarly, all regions and region short
7
+ codes * within a single country* are guaranteed to be unique.
6
8
7
- This repo contain the source data for the [ country-region-selector] ( https://github.com/benkeen/country-region-selector )
8
- script. As I plan on creating multiple versions of this script (React, Polymer, X-Tags, etc), I've moved the source
9
- data here so that each of the repos can pull from the single source.
9
+ I created this repo to house the raw data used for the [ country-region-selector] ( https://github.com/benkeen/country-region-selector ) ,
10
+ [ react-country-region-selector ] ( https://github.com/benkeen/react-country-region-selector ) scripts. I didn't want to
11
+ duplicate it in multiple places and hey, seems like this it could be useful to people as a standalone.
10
12
11
- See the ` data.json ` file for the data. It's of the form:
13
+ See the ` data.json ` file for the data. The JSON is of the form:
12
14
13
15
``` javascript
14
16
[
@@ -29,19 +31,43 @@ See the `data.json` file for the data. It's of the form:
29
31
30
32
### Contribute
31
33
32
- The state/prov abbreviations are not yet complete, so pull requests welcome! For more information, see:
33
- https://github.com/benkeen/country-region-selector/issues/2#issuecomment-98549680
34
+ The state/prov abbreviations are not yet complete, so pull requests welcome! Regions that need ISO3166-2 codes can
35
+ be identified by having a missing ` shortCode ` property for each region. You can find them by cloning the repo, then
36
+ running:
37
+
38
+ ```
39
+ npm install
40
+ grunt findIncomplete
41
+ ```
42
+
43
+ That'll list all countries with regions that are missing region short codes. Wikipedia has a lot of the data listed here:
44
+ https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
34
45
35
- Regions that need ISO3166-2 codes can be identified by having a missing ` shortCode ` property for each region.
36
46
37
- Before contributing a PR, you might want to validate the JSON content. To do that, do the following on your command line:
47
+ ### Data Validation
48
+
49
+ Before contributing a PR, please validate the JSON content (if you don't, Travis will catch it for you!). To do that,
50
+ run the following on your command line:
38
51
39
52
```
40
53
npm install
41
54
grunt validate
42
55
```
43
56
44
- That'll throw an error if the JSON is invalid.
57
+ That'll throw an error if the JSON is invalid or if some duplicate names were accidentally introduced. The error messages
58
+ are pretty clear, I think.
59
+
60
+
61
+ ### Changelog
62
+
63
+ - ` 1.3.0 ` - July 1, 2016. Improved validation added to ensure uniqueness of country names, short codes, region names and
64
+ shortcodes. Various country region additions / updates.
65
+ - ` 1.2.1 ` - Jun 7, 2016. Taiwan country name change. Travis build status added + basic JSON syntax validation.
66
+ - ` 1.2.0 ` - May 14, 2015. Lots more region short codes (again, thanks Ellen!). JSON syntax fixes.
67
+ - ` 1.1.1 ` - April 30, 2016. JSON syntax fixes.
68
+ - ` 1.1.0 ` - April 30, 2016. Looooads of new region shortcodes added thanks to [ ellenhutchings] ( https://github.com/ellenhutchings ) . Thanks, Ellen!
69
+ - ` 1.0.0 ` - April 29, 2016. initial version
70
+
45
71
46
72
### License
47
73
0 commit comments