Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Codes is a list of all ISO 639-1 two character codes. Codes []string // Names is a list of all ISO 639-1 english language names. Names []string // NativeNames is a list of all ISO 639-1 native language names. NativeNames []string )
var Languages = map[string]Language{}/* 184 elements not displayed */
Languages is a map of all ISO 639-1 languages using the two character lowercase language code as key.
Functions ¶
func CodeForName ¶
CodeForName returns the language code for given name.
func CodeForNativeName ¶
CodeForNativeName returns the language code for given native name.
func NativeName ¶
NativeName returns the language native name for given code.
func ValidCode ¶
ValidCode returns true if the given code is a valid ISO 639-1 language code. The code must be passed in lowercase.
func ValidName ¶
ValidName returns true if the given name is a valid ISO 639-1 language name. The name must use uppercase characters (e.g. English, Hiri Motu, ...).
func ValidNativeName ¶
ValidNativeName returns true if the given code is a valid ISO 639-1 language native name. The name must be passed in its native form (e.g. English, 中文, ...).
Types ¶
type Language ¶
Language is an ISO 639-1 language with code, name and native name.
func FromNativeName ¶
FromNativeName returns the language for given native name.