Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 1.72 KB

README.md

File metadata and controls

43 lines (28 loc) · 1.72 KB

ISO 639-3

Go Reference Test Go Report Card

A database of ISO 639-3, ISO 639-2 and ISO 639-1 languages.

Motivation

There's an excellent Go library for ISO 639-1, but it lacks ISO 639-2 and ISO 639-3 codes.

Data source

Database is generated (see cmd/generator.go) from official ISO 639-3 data. See official site of the ISO 639-3 Registration Authority for details.

Installation

go get github.com/barbashov/iso639-3

Examples

iso639_3.LanguagesPart3 // returns ISO 639-3 languages lookup table
iso639_3.LanguagesPart2 // returns ISO 639-2 languages lookup table
iso639_3.LanguagesPart1 // returns ISO 639-1 languages lookup table

iso639_3.FromAnyCode("eng") // returns object representing English language looking through ISO 639-3, ISO 639-2 and ISO 639-1 codes
iso639_3.FromPart3Code("deu") // returns object representing German language looking by ISO 639-3 code
iso639_3.FromPart2Code("ger") // returns object representing German language looking by ISO 639-2 code
iso639_3.FromPart1Code("de") // returns object representing German language looking by ISO 639-1 code
iso639_3.FromName("English") // returns object representing English language looking by language name

Contribute

Feel free to open issues and send pull requests.

License

MIT