l10n

package
v0.77.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 4 Imported by: 8

Documentation

Overview

Package l10n provides localization models and data.

Index

Constants

This section is empty.

Variables

View Source
var CountryDefinitions = []CountryDef{}/* 249 elements not displayed */

CountryDefinitions provides and array of country definitions including the official ISO country code, the name in English, and the countries top-level-domain name.

Functions

This section is empty.

Types

type Code added in v0.20.0

type Code string

Code is used for short identifiers like country or state codes. They are limited to upper-case letters and numbers only, and should be validated against region specific data.

const CodeEmpty Code = ""

CodeEmpty is used for matching empty codes.

func (Code) In added in v0.28.2

func (c Code) In(set ...Code) bool

In returns true if the code is contained inside the provided set

func (Code) JSONSchema added in v0.29.0

func (Code) JSONSchema() *jsonschema.Schema

JSONSchema provides a representation of the struct for usage in Schema.

func (Code) String added in v0.27.0

func (c Code) String() string

String provides string representation of code

func (Code) Validate added in v0.20.0

func (c Code) Validate() error

Validate ensures the code is formatted correctly.

type CountryCode added in v0.29.0

type CountryCode Code

CountryCode defines an ISO 3166-2 country code.

const (
	AF CountryCode = "AF"
	AX CountryCode = "AX"
	AL CountryCode = "AL"
	DZ CountryCode = "DZ"
	AS CountryCode = "AS"
	AO CountryCode = "AO"
	AI CountryCode = "AI"
	AQ CountryCode = "AQ"
	AG CountryCode = "AG"
	AR CountryCode = "AR"
	AM CountryCode = "AM"
	AW CountryCode = "AW"
	AU CountryCode = "AU"
	AT CountryCode = "AT"
	AZ CountryCode = "AZ"
	BS CountryCode = "BS"
	BH CountryCode = "BH"
	BD CountryCode = "BD"
	BB CountryCode = "BB"
	BY CountryCode = "BY"
	BE CountryCode = "BE"
	BZ CountryCode = "BZ"
	BJ CountryCode = "BJ"
	BM CountryCode = "BM"
	BT CountryCode = "BT"
	BO CountryCode = "BO"
	BQ CountryCode = "BQ"
	BA CountryCode = "BA"
	BW CountryCode = "BW"
	BV CountryCode = "BV"
	BR CountryCode = "BR"
	IO CountryCode = "IO"
	BN CountryCode = "BN"
	BG CountryCode = "BG"
	BF CountryCode = "BF"
	BI CountryCode = "BI"
	CV CountryCode = "CV"
	KH CountryCode = "KH"
	CM CountryCode = "CM"
	CA CountryCode = "CA"
	KY CountryCode = "KY"
	CF CountryCode = "CF"
	TD CountryCode = "TD"
	CL CountryCode = "CL"
	CN CountryCode = "CN"
	CX CountryCode = "CX"
	CC CountryCode = "CC"
	CO CountryCode = "CO"
	KM CountryCode = "KM"
	CG CountryCode = "CG"
	CD CountryCode = "CD"
	CK CountryCode = "CK"
	CR CountryCode = "CR"
	CI CountryCode = "CI"
	HR CountryCode = "HR"
	CU CountryCode = "CU"
	CW CountryCode = "CW"
	CY CountryCode = "CY"
	CZ CountryCode = "CZ"
	DK CountryCode = "DK"
	DJ CountryCode = "DJ"
	DM CountryCode = "DM"
	DO CountryCode = "DO"
	EC CountryCode = "EC"
	EG CountryCode = "EG"
	SV CountryCode = "SV"
	GQ CountryCode = "GQ"
	ER CountryCode = "ER"
	EE CountryCode = "EE"
	SZ CountryCode = "SZ"
	ET CountryCode = "ET"
	FK CountryCode = "FK"
	FO CountryCode = "FO"
	FJ CountryCode = "FJ"
	FI CountryCode = "FI"
	FR CountryCode = "FR"
	GF CountryCode = "GF"
	PF CountryCode = "PF"
	TF CountryCode = "TF"
	GA CountryCode = "GA"
	GM CountryCode = "GM"
	GE CountryCode = "GE"
	DE CountryCode = "DE"
	GH CountryCode = "GH"
	GI CountryCode = "GI"
	GR CountryCode = "GR"
	GL CountryCode = "GL"
	GD CountryCode = "GD"
	GP CountryCode = "GP"
	GU CountryCode = "GU"
	GT CountryCode = "GT"
	GG CountryCode = "GG"
	GN CountryCode = "GN"
	GW CountryCode = "GW"
	GY CountryCode = "GY"
	HT CountryCode = "HT"
	HM CountryCode = "HM"
	VA CountryCode = "VA"
	HN CountryCode = "HN"
	HK CountryCode = "HK"
	HU CountryCode = "HU"
	IS CountryCode = "IS"
	IN CountryCode = "IN"
	ID CountryCode = "ID"
	IR CountryCode = "IR"
	IQ CountryCode = "IQ"
	IE CountryCode = "IE"
	IM CountryCode = "IM"
	IL CountryCode = "IL"
	IT CountryCode = "IT"
	JM CountryCode = "JM"
	JP CountryCode = "JP"
	JE CountryCode = "JE"
	JO CountryCode = "JO"
	KZ CountryCode = "KZ"
	KE CountryCode = "KE"
	KI CountryCode = "KI"
	KP CountryCode = "KP"
	KR CountryCode = "KR"
	KW CountryCode = "KW"
	KG CountryCode = "KG"
	LA CountryCode = "LA"
	LV CountryCode = "LV"
	LB CountryCode = "LB"
	LS CountryCode = "LS"
	LR CountryCode = "LR"
	LY CountryCode = "LY"
	LI CountryCode = "LI"
	LT CountryCode = "LT"
	LU CountryCode = "LU"
	MO CountryCode = "MO"
	MG CountryCode = "MG"
	MW CountryCode = "MW"
	MY CountryCode = "MY"
	MV CountryCode = "MV"
	ML CountryCode = "ML"
	MT CountryCode = "MT"
	MH CountryCode = "MH"
	MQ CountryCode = "MQ"
	MR CountryCode = "MR"
	MU CountryCode = "MU"
	YT CountryCode = "YT"
	MX CountryCode = "MX"
	FM CountryCode = "FM"
	MD CountryCode = "MD"
	MC CountryCode = "MC"
	MN CountryCode = "MN"
	ME CountryCode = "ME"
	MS CountryCode = "MS"
	MA CountryCode = "MA"
	MZ CountryCode = "MZ"
	MM CountryCode = "MM"
	NA CountryCode = "NA"
	NR CountryCode = "NR"
	NP CountryCode = "NP"
	NL CountryCode = "NL"
	NC CountryCode = "NC"
	NZ CountryCode = "NZ"
	NI CountryCode = "NI"
	NE CountryCode = "NE"
	NG CountryCode = "NG"
	NU CountryCode = "NU"
	NF CountryCode = "NF"
	MK CountryCode = "MK"
	MP CountryCode = "MP"
	NO CountryCode = "NO"
	OM CountryCode = "OM"
	PK CountryCode = "PK"
	PW CountryCode = "PW"
	PS CountryCode = "PS"
	PA CountryCode = "PA"
	PG CountryCode = "PG"
	PY CountryCode = "PY"
	PE CountryCode = "PE"
	PH CountryCode = "PH"
	PN CountryCode = "PN"
	PL CountryCode = "PL"
	PT CountryCode = "PT"
	PR CountryCode = "PR"
	QA CountryCode = "QA"
	RE CountryCode = "RE"
	RO CountryCode = "RO"
	RU CountryCode = "RU"
	RW CountryCode = "RW"
	BL CountryCode = "BL"
	SH CountryCode = "SH"
	KN CountryCode = "KN"
	LC CountryCode = "LC"
	MF CountryCode = "MF"
	PM CountryCode = "PM"
	VC CountryCode = "VC"
	WS CountryCode = "WS"
	SM CountryCode = "SM"
	ST CountryCode = "ST"
	SA CountryCode = "SA"
	SN CountryCode = "SN"
	RS CountryCode = "RS"
	SC CountryCode = "SC"
	SL CountryCode = "SL"
	SG CountryCode = "SG"
	SX CountryCode = "SX"
	SK CountryCode = "SK"
	SI CountryCode = "SI"
	SB CountryCode = "SB"
	SO CountryCode = "SO"
	ZA CountryCode = "ZA"
	GS CountryCode = "GS"
	SS CountryCode = "SS"
	ES CountryCode = "ES"
	LK CountryCode = "LK"
	SD CountryCode = "SD"
	SR CountryCode = "SR"
	SJ CountryCode = "SJ"
	SE CountryCode = "SE"
	CH CountryCode = "CH"
	SY CountryCode = "SY"
	TW CountryCode = "TW"
	TJ CountryCode = "TJ"
	TZ CountryCode = "TZ"
	TH CountryCode = "TH"
	TL CountryCode = "TL"
	TG CountryCode = "TG"
	TK CountryCode = "TK"
	TO CountryCode = "TO"
	TT CountryCode = "TT"
	TN CountryCode = "TN"
	TR CountryCode = "TR"
	TM CountryCode = "TM"
	TC CountryCode = "TC"
	TV CountryCode = "TV"
	UG CountryCode = "UG"
	UA CountryCode = "UA"
	AE CountryCode = "AE"
	GB CountryCode = "GB" // Great Britain and Northern Ireland
	US CountryCode = "US" // United States
	UM CountryCode = "UM"
	UY CountryCode = "UY"
	UZ CountryCode = "UZ"
	VU CountryCode = "VU"
	VE CountryCode = "VE"
	VN CountryCode = "VN"
	VG CountryCode = "VG"
	VI CountryCode = "VI"
	WF CountryCode = "WF"
	EH CountryCode = "EH"
	YE CountryCode = "YE"
	ZM CountryCode = "ZM"
	ZW CountryCode = "ZW"
)

List of all ISO 3166-2 country codes that we know about.

func (CountryCode) In added in v0.29.0

func (c CountryCode) In(set ...CountryCode) bool

In returns true if the country code is contained inside the provided set

func (CountryCode) JSONSchema added in v0.29.0

func (CountryCode) JSONSchema() *jsonschema.Schema

JSONSchema provides a representation of the struct for usage in Schema.

func (CountryCode) Name added in v0.29.0

func (c CountryCode) Name() string

Name provides the Country Name for the code

func (CountryCode) String added in v0.29.0

func (c CountryCode) String() string

String provides string representation of the country code

func (CountryCode) Validate added in v0.29.0

func (c CountryCode) Validate() error

Validate ensures the country code is inside the known and valid list of countries.

type CountryDef added in v0.29.0

type CountryDef struct {
	// ISO 3166-2 Country code
	Code CountryCode `json:"code" jsonschema:"ISO Country Code"`
	// English name of the country
	Name string `json:"name" jsonschema:"Name"`
	// Internet Top-Level-Domain
	TLD string `json:"tld" jsonschema:"Top level domain"`
}

CountryDef provides the structure use to define a Country Code definition.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL