locales

package
v0.94.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 7 Imported by: 4

Documentation

Overview

Package locales 为 web 包提供了本地化的内容

Index

Constants

View Source
const (
	NotFound                = localeutil.StringPhrase("not found")
	InvalidFormat           = localeutil.StringPhrase("invalid format")
	InvalidValue            = localeutil.StringPhrase("invalid value")
	CanNotBeEmpty           = localeutil.StringPhrase("can not be empty")
	DuplicateValue          = localeutil.StringPhrase("duplicate value")
	UniqueIdentityGenerator = localeutil.StringPhrase("unique identity generator")
	RecycleLocalCache       = localeutil.StringPhrase("recycle local cache")
)

Variables

Locales 当前框架依赖的所有本地化内容

文件格式均为 yaml,使用时加载这些文件系统下的 yaml 文件即可:

s := server.New(...)
s.Locale().LoadMessages("*.yaml", locales.Locales()...)

Functions

func ErrCanNotBeEmpty added in v0.87.0

func ErrCanNotBeEmpty() error

func ErrInvalidFormat added in v0.87.4

func ErrInvalidFormat() error

func ErrInvalidValue added in v0.87.0

func ErrInvalidValue() error

func ErrNotFound added in v0.87.0

func ErrNotFound() error

func ShouldGreatThan added in v0.87.0

func ShouldGreatThan[T any](n T) localeutil.Stringer

ShouldGreatThan 返回必须大于 n 的翻译项

Types

This section is empty.

Jump to

Keyboard shortcuts

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