i18n

package
v4.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DictFileRegister

func DictFileRegister(files ...string)

func DictRegister

func DictRegister(m map[string]map[string]string)

func Fprintf

func Fprintf(w io.Writer, key message.Reference, a ...interface{}) (n int, err error)

Fprintf is like fmt.Fprintf, but using language-specific formatting.

func Init

func Init(configs ...I18nSection) error

Init will init i18n support via input language.

func Printf

func Printf(format string, a ...interface{})

Printf is like fmt.Printf, but using language-specific formatting.

func Sprint

func Sprint(a ...interface{}) string

Sprint is like fmt.Sprint, but using language-specific formatting.

func Sprintf

func Sprintf(format string, a ...interface{}) string

Sprintf formats according to a format specifier and returns the resulting string.

Types

type I18nSection

type I18nSection struct {
	Lang     string `yaml:"lang"`
	DictPath string `yaml:"dictPath"`
}

func (*I18nSection) Validate

func (p *I18nSection) Validate() error

Jump to

Keyboard shortcuts

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