localize

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInstance

func NewInstance()

NewInstance init i18n instance

Types

type ControllerInstance

type ControllerInstance struct {
	// contains filtered or unexported fields
}
var Instance *ControllerInstance

func (*ControllerInstance) ConfigIris

func (c *ControllerInstance) ConfigIris(app *iris.Application)

ConfigIris config iris i18n

func (*ControllerInstance) Load

func (c *ControllerInstance) Load(globPattern string, languages ...string) error

Load is a method shortcut to load files using a filepath.Glob pattern. It returns a non-nil error on failure.

func (*ControllerInstance) LoadFS

func (c *ControllerInstance) LoadFS(fileSystem fs.FS, pattern string, languages ...string) error

LoadFS is a method shortcut to load files using an `embed.FS` or `fs.FS` or `http.FileSystem` value. The "pattern" is a classic glob pattern.

func (*ControllerInstance) Tr

func (c *ControllerInstance) Tr(lang string, key string, args ...interface{}) string

Tr returns a translated message based on the "lang" language code and its key with any optional arguments attached to it.

func (*ControllerInstance) TrDefault

func (c *ControllerInstance) TrDefault(key string, args ...interface{}) string

TrDefault returns a translated message based on the default language code and its key with any optional arguments attached to it.

Jump to

Keyboard shortcuts

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