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
ember install ember-i18n-iso-countries
import { getName } from 'ember-i18n-iso-countries';
console.log("US (Alpha-2) => " + getName("US", "en")); // United States
console.log("US (Alpha-2) => " + getName("US", "de")); // Vereinigte Staaten von Amerika
console.log("USA (Alpha-3) => " + getName("USA", "en")); // United States
console.log("USA (Numeric) => " + getName("840", "en")); // United States
import { getNames } from 'ember-i18n-iso-countries';
console.log(getNames("en")); // { 'AF': 'Afghanistan', 'AL': 'Albania', [...], 'ZM': 'Zambia', 'ZW': 'Zimbabwe' }
en
: englishde
: germannl
: dutchfr
: frenchsv
: swedishes
: spanishpt
: portuguesefi
: finnishru
: russianar
: arabiczh
: chinese
import { getAlpha2Code } from 'ember-i18n-iso-countries';
console.log("United States => " + getAlpha2Code('United States', 'en')); // US
import { alpha3ToAlpha2 } from 'ember-i18n-iso-countries';
console.log("USA (Alpha-3) => " + alpha3ToAlpha2("USA") + " (Alpha-2)"); // United States
import { numericToAlpha2 } from 'ember-i18n-iso-countries';
console.log("840 (Numeric) => " + numericToAlpha2("840") + " (Alpha-2)"); // United States
import { alpha2ToAlpha3 } from 'ember-i18n-iso-countries';
console.log("DE (Alpha-2) => " + alpha2ToAlpha3("DE") + " (Alpha-3)"); // Germany
import { numericToAlpha3 } from 'ember-i18n-iso-countries';
console.log("840 (Numeric) => " + numericToAlpha3("840") + " (Alpha-3)"); // United States
import { alpha3ToNumeric } from 'ember-i18n-iso-countries';
console.log(alpha3ToNumeric("SWE")); // 752
import { alpha2ToNumeric } from 'ember-i18n-iso-countries';
console.log(alpha2ToNumeric("SE")); // 752
import { getAlpha2Codes } from 'ember-i18n-iso-countries';
console.log(getAlpha2Codes()); // { 'AF': 'AFG', 'AX': 'ALA', [...], 'ZM': 'ZMB', 'ZW': 'ZWE' }
import { getAlpha3Codes } from 'ember-i18n-iso-countries';
console.log(getAlpha3Codes()); // { 'AFG': 'AF', 'ALA': 'AX', [...], 'ZMB': 'ZM', 'ZWE': 'ZW' }
import { getNumericCodes } from 'ember-i18n-iso-countries';
console.log(getNumericCodes()); // { '4': 'AF', '8': 'AL', [...], '887': 'YE', '894': 'ZM' }
ember test
ember test --server
ember build
For more information on using ember-cli, visit http://www.ember-cli.com/.
##Contributing
PRs welcome!