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 ¶
View Source
var Locales = []fs.FS{ locales, localeutilL.Locales, config.Locales, cache.Locales, scheduled.Locales, }
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.
Click to show internal directories.
Click to hide internal directories.