Documentation ¶
Index ¶
- Constants
- func Current() *gotext.Locale
- func Get(str string, vars ...any) string
- func GetFromDomain(domain, str string, vars ...any) string
- func LoadCustomLocale(locale string, localeFS fs.FS)
- func LoadLocale(defaultLocaleDomain fs.FS)
- func RegisterLocaleDomain(domain string, fs fs.FS)
- func Sprintf(str string, vars ...any) string
- func Time(t time.Time, long bool) string
- func TimeAgo(timestamp time.Time) string
- type Localized
Constants ¶
View Source
const ( Day = 24 * time.Hour Week = 7 * Day Year = 365 * Day )
Variables ¶
This section is empty.
Functions ¶
func GetFromDomain ¶
GetFromDomain returns the translated string from the given reference and domain. Use this if your string is in a different domain.
func LoadCustomLocale ¶
LoadCustomLocale loads the locale from the given filesystem.
func LoadLocale ¶
LoadLocale loads the locale from the given filesystem. It will try to find the best match for the current locale.
func RegisterLocaleDomain ¶
RegisterLocaleDomain registers a locale domain. This is used to load translations from a different domain.
Types ¶
Click to show internal directories.
Click to hide internal directories.