Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lang ¶
type Lang struct { Name string `json:"name"` Code string `json:"code"` Variants []LangVariant `json:"variants"` }
Lang contatins the name of a language, as well as its "top level" ISO code, and a list of possible `LangVariants` that the language can have.
type LangCodes ¶
LangCodes contains the "top lever" and "sub
func GetLangCodes ¶
GetLangCodes return a LangCodes from the ISO language code. If the string has bad format, or the ISO code is not valid, will return a nil pointer.
type LangCodesAndNames ¶
type LangCodesAndNames struct { Code string `json:"code"` VariantCode string `json:"variantCode"` Name string `json:"name"` VariantName string `json:"variantName"` }
LangCodesAndNames contains all the data for a language (including its variation) flattened in a single struct
func GetLangCodesAndNames ¶
func GetLangCodesAndNames(lang string) *LangCodesAndNames
GetLangCodesAndNames returns a LangCodesAndNames for a given lang ISO code string. If the string format is incorrect, or it does not represent a valid ISO code it will return nil.
func (*LangCodesAndNames) Lang ¶
func (lcan *LangCodesAndNames) Lang() string
Lang returns the ISO string code for the language (and its variation, if that exists in the structure).
type LangVariant ¶
LangVariant contains the variant name, and variant code of a language variant.