A GO implementation of the ISO 639.
Go to file
2023-10-01 08:51:38 +02:00
go.mod inital commit 2023-10-01 08:51:38 +02:00
iso_639_test.go inital commit 2023-10-01 08:51:38 +02:00
iso_639-1_test.go inital commit 2023-10-01 08:51:38 +02:00
iso_639-1.go inital commit 2023-10-01 08:51:38 +02:00
iso_639-2b_test.go inital commit 2023-10-01 08:51:38 +02:00
iso_639-2b.go inital commit 2023-10-01 08:51:38 +02:00
iso_639-2t_test.go inital commit 2023-10-01 08:51:38 +02:00
iso_639-2t.go inital commit 2023-10-01 08:51:38 +02:00
iso_639.go inital commit 2023-10-01 08:51:38 +02:00
LICENSE inital commit 2023-10-01 08:51:38 +02:00
README.md inital commit 2023-10-01 08:51:38 +02:00

ISO-639

A GO implementation of the ISO 639. Match language codes to language names and vice versa. Support for ISO 639-1, ISO 639-2/B and ISO 639-2/T.

Usage

import (
	"git.0x0001f346.de/andreas/iso639"
)

// general
languageName, err := iso639.GetLanguageNameForISO639Code("nl") // ("Dutch", nil)
languageName, err = iso639.GetLanguageNameForISO639Code("nld") // ("Dutch", nil)
languageName, err = iso639.GetLanguageNameForISO639Code("dut") // ("Dutch", nil)

// ISO 639-1
languageName, err = iso639.GetLanguageNameForISO639Code("nl") // ("Dutch", nil)
languagCode, err := iso639.GetISO639_1CodeForLanguageName("Dutch") // ("nl", nil)
languagCodes := iso639.GetAllISO639_1Codes() // []string{"aa", "ab", "ae", "af", "ak", ...}
languagNames := iso639.GetAllISO639_1Names() // []string{"Abkhazian", "Afar", "Afrikaans", "Akan", "Albanian", ...}

// ISO 639-2/B
languageName, err = iso639.GetLanguageNameForISO639_2BCode("nld") // ("Dutch", nil)
languagCode, err = iso639.GetISO639_2BCodeForLanguageName("Dutch") // ("nld", nil)
languagCodes = iso639.GetAllISO639_2BCodes() // []string{"aar", "abk", "afr", "aka", "alb", ...}
languagNames = iso639.GetAllISO639_2BNames() // []string{"Abkhazian", "Afar", "Afrikaans", "Akan", "Albanian", ...}

// ISO 639-2/T
languageName, err = iso639.GetLanguageNameForISO639_2TCode("dut") // ("Dutch", nil)
languagCode, err = iso639.GetISO639_2TCodeForLanguageName("Dutch") // ("dut", nil)
languagCodes = iso639.GetAllISO639_2TCodes() // []string{"aar", "abk", "afr", "aka", "amh", ...}
languagNames = iso639.GetAllISO639_2TNames() // []string{"Abkhazian", "Afar", "Afrikaans", "Akan", "Albanian", ...}