i18n

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

message_source 用来处理国际化资源

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLocalized

func GetLocalized(code string, lang language.Tag, a ...interface{}) string

func Load

func Load(paths ...string)

func ReFormatToPlain

func ReFormatToPlain(path string)

解析gotext extract产生的json文件,包装成自己项目中的json格式 ERR开头的错误文件放前面

Types

type GlobalizationMessage

type GlobalizationMessage struct {
	Code string `json:"code"`
	En   string `json:"en_US"`
	Cn   string `json:"zh_CN"`
}

自己定义的国际化资源

type MessageSource

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

func NewMessageSource

func NewMessageSource() *MessageSource

func (*MessageSource) GetLocalized

func (ms *MessageSource) GetLocalized(code string, lang language.Tag, a ...interface{}) string

func (*MessageSource) Load

func (ms *MessageSource) Load(paths ...string)

Jump to

Keyboard shortcuts

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