i18n

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// common msg
	Success             = "common.success"
	Failed              = "common.failed"
	UpdateSuccess       = "common.updateSuccess"
	UpdateFailed        = "common.updateFailed"
	CreateSuccess       = "common.createSuccess"
	CreateFailed        = "common.createFailed"
	DeleteSuccess       = "common.deleteSuccess"
	DeleteFailed        = "common.deleteFailed"
	ChangeStatusSuccess = "common.changeStatusSuccess"
	ChangeStatusFailed  = "common.changeStatusFailed"
	TargetNotFound      = "common.targetNotExist"
	DatabaseError       = "common.databaseError"
	RedisError          = "common.redisError"
	AlreadyInit         = "init.alreadyInit"
	InitRunning         = "init.initializeIsRunning"

	// front end msg
	ApiRequestFailed = "sys.api.apiRequestFailed"
)

Variables

View Source
var LocaleFS embed.FS

Functions

This section is empty.

Types

type Translator

type Translator struct {
	// contains filtered or unexported fields
}

func (*Translator) MatchLocalizer

func (l *Translator) MatchLocalizer(lang string) *i18n.Localizer

func (*Translator) NewBundle

func (l *Translator) NewBundle(file embed.FS)

func (*Translator) NewTranslator

func (l *Translator) NewTranslator()

func (*Translator) Trans

func (l *Translator) Trans(lang string, msgId string) string

func (*Translator) TransError

func (l *Translator) TransError(lang string, err error) error

Jump to

Keyboard shortcuts

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