Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/vtex/i18n-country-code
- Owner: vtex
- Created: 2017-07-18T14:30:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-04-12T16:31:51.000Z (over 1 year ago)
- Last Synced: 2024-11-17T05:38:31.431Z (about 2 months ago)
- Topics: srv-checkout-ui, xp-shopping
- Language: JavaScript
- Size: 23.4 KB
- Stars: 1
- Watchers: 124
- 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)