i18n

package
v0.0.0-...-7745932 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 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"

	// login msg
	UserAlreadyExist   = "login.userAlreadyExist"
	MobileAlreadyExist = "login.mobileAlreadyExist"
	EmailAlreadyExist  = "login.emailAlreadyExist"

	// 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