i18n

package
v0.0.0-...-f5ed4d4 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: AGPL-3.0 Imports: 9 Imported by: 3 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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