Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vtex/i18n-country-code

Translations for country codes
https://github.com/vtex/i18n-country-code

srv-checkout-ui xp-shopping

Last synced: about 1 month ago
JSON representation

Translations for country codes

Awesome Lists containing this project

README

        

# i18n-country-code

> Translations for country names based on its ISO Alpha 3 country code.

## Install

```sh
$ npm install --save i18n-country-code
```

## Usage

### Node.js

```js
const translations = require("i18n-country-code/locales/en.json");

const countryName = translations["USA"];
// United States
```

### Webpack

Use it with dynamic import.

```js
const locale = "en"

import(`i18n-country-code/locales/${locale}.json`)
.then(translations => {
const countryName = translations["USA"];
// United States
})
```

## License

MIT © [VTEX](https://www.vtex.com)