Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = "1.0.3"
Version is the current version of the i18n package.
Functions ¶
This section is empty.
Types ¶
type I18n ¶
type I18n interface { // Load loads the given locale and translations into the I18n instance. Load(fn func() (map[string]Translations, error)) error // Translate translates the given key with the given arguments. Translate(locale string, key string, data ...map[string]any) (string, error) // T is an alias for Translate. T(locale string, key string, data ...map[string]any) string // LoadFromFile loads the given locale and translations into the I18n instance. LoadFromFile(filepath string) error // LoadFromDir loads the given locale and translations into the I18n instance. LoadFromDir(dir string) error // LoadFromURL loads the given locale and translations into the I18n instance. LoadFromURL(url string) error // IsLocalesLoaded() bool // GetLocales returns the loaded locales. GetLocales() map[string]Translations }
I18n ...
Click to show internal directories.
Click to hide internal directories.