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: 8 months ago
JSON representation
Translations for country codes
- Host: GitHub
- URL: https://github.com/vtex/i18n-country-code
- Owner: vtex
- Created: 2017-07-18T14:30:25.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-04-12T16:31:51.000Z (about 3 years ago)
- Last Synced: 2025-03-27T22:38:56.616Z (about 1 year ago)
- Topics: srv-checkout-ui, xp-shopping
- Language: JavaScript
- Size: 23.4 KB
- Stars: 1
- Watchers: 122
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
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)