Ember-i18n-iso-countries
Ember.js Addon Wrapper for the i18n-iso-countries.
i18n for ISO 3166-1 country codes. We support Alpha-2, Alpha-3 and Numeric codes from http://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements
Installation
ember install ember-i18n-iso-countries
Code to Country
Get the name of a country by it's ISO 3166-1 Alpha-2, Alpha-3 or Numeric code
;console; // United Statesconsole; // Vereinigte Staaten von Amerikaconsole; // United Statesconsole; // United States
Get all names by their ISO 3166-1 Alpha-2 code
;console; // { 'AF': 'Afghanistan', 'AL': 'Albania', [...], 'ZM': 'Zambia', 'ZW': 'Zimbabwe' }
Supported languages
en
: englishde
: germannl
: dutchfr
: frenchsv
: swedishes
: spanishpt
: portuguesefi
: finnishru
: russianar
: arabiczh
: chinese
Country to Code
;console; // US
Codes
Convert Alpha-3 to Alpha-2 code
;console; // United States
Convert Numeric to Alpha-2 code
;console; // United States
Convert Alpha-2 to Alpha-3 coe
;console; // Germany
Convert Numeric to Alpha-3 code
;console; // United States
Convert Alpha-3 to Numeric code
;console; // 752
Convert Alpha-2 to Numeric code
;console; // 752
Get all Alpha-2 codes
;console; // { 'AF': 'AFG', 'AX': 'ALA', [...], 'ZM': 'ZMB', 'ZW': 'ZWE' }
Get all Alpha-3 codes
;console; // { 'AFG': 'AF', 'ALA': 'AX', [...], 'ZMB': 'ZM', 'ZWE': 'ZW' }
Get all Numeric codes
;console; // { '4': 'AF', '8': 'AL', [...], '887': 'YE', '894': 'ZM' }
Running Tests
ember test
ember test --server
Building
ember build
For more information on using ember-cli, visit http://www.ember-cli.com/.
Contributing
PRs welcome!