i18n

package
v0.0.0-...-4b98c26 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadLocale

func LoadLocale(locale, contextName string, rawPO []byte)

LoadLocale creates the translation object for a locale from the content of a .po file

func LocalizeTime

func LocalizeTime(t time.Time, locale, layout string) string

LocalizeTime transforms a date+time in a string for the given locale. The layout is in the same format as the one given to time.Format.

func Translate

func Translate(key, locale, contextName string, vars ...interface{}) string

Translate translates the given key on the specified locale.

func Translator

func Translator(locale, contextName string) func(key string, vars ...interface{}) string

Translator returns a translation function of the locale specified

func TranslatorHTML

func TranslatorHTML(locale, contextName string) func(key string, vars ...interface{}) template.HTML

TranslatorHTML returns a translation function of the locale specified, which allow simple markup like **bold**.

Types

This section is empty.

Jump to

Keyboard shortcuts

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