/iso639-2

ISO 639-2 database for Go

Primary LanguageGoMIT LicenseMIT

Deprecated

Please use https://github.com/barbashov/iso639-3 instead.

ISO 639-2

Go Reference Test Go Report Card

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

Generated from official ISO 639-2 list, so no native names, unfortunately :(

Motivation

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

Data source

Database is generated (see cmd/generator.go) from official ISO 639-2 data. See The Library of Congress website for details.

Installation

go get github.com/barbashov/iso639-2

Examples

iso639_2.Languages // returns languages lookup table

iso639_2.FromCode("eng") // returns object representing English language
iso639_2.FromEnglishName("English") // returns object representing English language
iso639_2.FromFrenchName("anglais") // returns object representing English language

Contribute

Feel free to open issues and send pull requests.

License

MIT