locale

package
v7.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Locale

type Locale struct {
	// contains filtered or unexported fields
}

Locale service

func New

func New(clt client.Client) *Locale

func (*Locale) Get

func (srv *Locale) Get() (*models.Locale, error)

Get get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.

([IP Geolocation by DB-IP](https://db-ip.com))

func (*Locale) ListCodes

func (srv *Locale) ListCodes() (*models.LocaleCodeList, error)

ListCodes list of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).

func (*Locale) ListContinents

func (srv *Locale) ListContinents() (*models.ContinentList, error)

ListContinents list of all continents. You can use the locale header to get the data in a supported language.

func (*Locale) ListCountries

func (srv *Locale) ListCountries() (*models.CountryList, error)

ListCountries list of all countries. You can use the locale header to get the data in a supported language.

func (*Locale) ListCountriesEU

func (srv *Locale) ListCountriesEU() (*models.CountryList, error)

ListCountriesEU list of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.

func (*Locale) ListCountriesPhones

func (srv *Locale) ListCountriesPhones() (*models.PhoneList, error)

ListCountriesPhones list of all countries phone codes. You can use the locale header to get the data in a supported language.

func (*Locale) ListCurrencies

func (srv *Locale) ListCurrencies() (*models.CurrencyList, error)

ListCurrencies list of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.

func (*Locale) ListLanguages

func (srv *Locale) ListLanguages() (*models.LanguageList, error)

ListLanguages list of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.

Jump to

Keyboard shortcuts

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