Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mamantoha/iso_codes
π Lists of various ISO standards (ISO 3166-1 for countries and ISO 639-2 for languages) with translations for Crystal
https://github.com/mamantoha/iso_codes
countries crystal emoji hacktoberfest iso-3166-1 iso-639-1 languages
Last synced: 2 months ago
JSON representation
π Lists of various ISO standards (ISO 3166-1 for countries and ISO 639-2 for languages) with translations for Crystal
- Host: GitHub
- URL: https://github.com/mamantoha/iso_codes
- Owner: mamantoha
- License: mit
- Created: 2021-02-21T12:56:20.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-30T07:25:08.000Z (8 months ago)
- Last Synced: 2024-10-04T18:31:17.001Z (3 months ago)
- Topics: countries, crystal, emoji, hacktoberfest, iso-3166-1, iso-639-1, languages
- Language: Crystal
- Homepage:
- Size: 2.49 MB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ISO Codes
[![Crystal CI](https://github.com/mamantoha/iso_codes/actions/workflows/crystal.yml/badge.svg)](https://github.com/mamantoha/iso_codes/actions/workflows/crystal.yml)
[![GitHub release](https://img.shields.io/github/release/mamantoha/iso_codes.svg)](https://github.com/mamantoha/iso_codes/releases)
[![License](https://img.shields.io/github/license/mamantoha/iso_codes.svg)](https://github.com/mamantoha/iso_codes/blob/master/LICENSE)This project provides lists of various ISO standards (`ISO 3166-1` for countries and `ISO 639-2` for languages) with translations for Crystal programming language.
## ISO 3166-1
This lists the 2-letter country code and "short" country name. The
official ISO 3166-1 maintenance agency is ISO.## ISO 639-2
This lists the 2-letter and 3-letter language codes and language
names. The official ISO 639-2 maintenance agency is the Library of
Congress.## Translations
* 249 Country codes (`ISO 3166-1` - 2 letter) in 161 Languages
* 487 Language codes (`ISO_639-2` - 2 letter) in 98 Languages## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
iso_codes:
github: mamantoha/iso_codes
```2. Run `shards install`
## Usage
```crystal
require "iso_codes"country = ISOCodes.countries.find_by_alpha_2("UA")
# => #country.translation("pt")
# => UcrΓ’nialanguage = ISOCodes.languages.find_by_name("Ukrainian")
# => #language.translation("fr")
# => Ukrainien
```## Development
Update data from to make changes available to users:
```
make update_data
```## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## Contributors
- [Anton Maminov](https://github.com/mamantoha) - creator and maintainer