https://github.com/rmm5t/iso639
:earth_americas::earth_asia: A ruby gem for ISO 639-1 and ISO 639-2 lookups by name, alpha-2 code, or alpha-3 code
https://github.com/rmm5t/iso639
iso639 language ruby
Last synced: about 1 year ago
JSON representation
:earth_americas::earth_asia: A ruby gem for ISO 639-1 and ISO 639-2 lookups by name, alpha-2 code, or alpha-3 code
- Host: GitHub
- URL: https://github.com/rmm5t/iso639
- Owner: rmm5t
- License: mit
- Created: 2012-12-24T15:54:40.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2025-01-03T00:30:51.000Z (over 1 year ago)
- Last Synced: 2025-05-03T23:44:09.396Z (about 1 year ago)
- Topics: iso639, language, ruby
- Language: Ruby
- Homepage:
- Size: 52.7 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
# iso639
[](http://badge.fury.io/rb/iso639)
[](https://github.com/rmm5t/iso639/actions?query=workflow%3ACI)
[](https://codeclimate.com/github/rmm5t/iso639/maintainability)
[](https://rubygems.org/gems/iso639)
The iso639 gem provides convenience methods for looking up ISO-639-1 or
ISO-639-2 language codes by their english name, 2-char, or 3-char counterpart
All data was generated from the Library of Congress's list of UTF-8
[**Codes for the Representation of Names of Languages**](http://www.loc.gov/standards/iso639-2/ascii_8bits.html).
## Installation
Add this line to your application's Gemfile:
```ruby
gem "iso639"
```
And then execute:
```bash
$ bundle
```
Or install it yourself as:
```bash
$ gem install iso639
```
## Usage
```ruby
require "iso639"
# Lookup by alpha-2 codes
Iso639["en"] # => "English"
Iso639["en"].alpha2 # => "en"
Iso639["en"].alpha3 # => "eng"
Iso639["en"].alpha3_bibliographic # => "eng"
Iso639["en"].alpha3_terminology # => "eng"
Iso639["en"].name # => "English"
Iso639["en"].english_name # => "English"
Iso639["en"].french_name # => "anglais"
# Lookup by alpha-3-bibliographic codes
Iso639["fre"] # => "French"
Iso639["fre"].alpha2 # => "fr"
Iso639["fre"].alpha3 # => "fre"
Iso639["fre"].alpha3_bibliographic # => "fre"
Iso639["fre"].alpha3_terminology # => "fra"
Iso639["fre"].name # => "French"
Iso639["fre"].english_name # => "French"
Iso639["fre"].french_name # => "français"
# Lookup by alpha-3-terminology codes
Iso639["fra"] # => "French"
Iso639["fra"].alpha2 # => "fr"
Iso639["fra"].alpha3 # => "fre"
Iso639["fra"].alpha3_bibliographic # => "fre"
Iso639["fra"].alpha3_terminology # => "fra"
Iso639["fra"].name # => "French"
Iso639["fra"].english_name # => "French"
Iso639["fra"].french_name # => "français"
# Lookup by name
Iso639["German"] # => "German"
Iso639["German"].alpha2 # => "de"
Iso639["German"].alpha3 # => "ger"
Iso639["German"].alpha3_bibliographic # => "ger"
Iso639["German"].alpha3_terminology # => "deu"
Iso639["German"].name # => "German"
Iso639["German"].english_name # => "German"
Iso639["German"].french_name # => "allemand"
# Retrieve alpha-2 codes
Iso639["English"].alpha2 # => "en"
Iso639["fre"].alpha2 # => "fr"
Iso639["deu"].alpha2 # => "de"
Iso639["pl"].alpha2 # => "pl"
# Retrieve alpha-3 codes
Iso639["english"].alpha3 # => "eng"
Iso639["fr"].alpha3 # => "fre"
Iso639["ger"].alpha3 # => "ger"
# Retrieve names
Iso639["eng"].name # => "English"
Iso639["fr"].name # => "French"
Iso639["de"].name # => "German"
Iso639["deu"].name # => "German"
Iso639["ger"].name # => "German"
Iso639["german"].name # => "German"
Iso639["GeRmAn"].name # => "German"
```
## Versioning
Semantic Versioning 2.0 as defined at .
## License
[MIT License](https://rmm5t.mit-license.org/)