i18n

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Default lang key used to get the language from the ParseContext
	LangKey = "lang"
)

Variables

This section is empty.

Functions

func SetLanguagesErrsMap

func SetLanguagesErrsMap(m map[string]zconst.LangMap, defaultLang string, opts ...setLanguageOption)

Takes a map[langKey]conf.LangMap usage is i18n.SetLanguagesErrsMap(map[string]zconst.LangMap{ "es": es.Map, "en": en.Map, }, "en", i18n.WithLangKey("langKey")) schema.Parse(data, &dest, z.WithCtxValue("langKey", "es"))

func WithLangKey

func WithLangKey(key string) setLanguageOption

Override the default lang key used to get the language from the ParseContext

Types

type LangMap

type LangMap = zconst.LangMap

Proxy the type for easy use

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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