i18n

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: MIT Imports: 15 Imported by: 3

Documentation

Index

Constants

View Source
const (
	SERVICE_X_LANGUAGE          = "x-lang"
	URI_LIST_STRINGS_BY_APPNAME = "/lang/string/list"
	URI_GET_APP_STRINGS_VERSION = "/lang/string/app/version"
)

Variables

This section is empty.

Functions

func CheckParametersLost

func CheckParametersLost(params map[string]string, paramNames ...string) models.Result

func Error

func Error(code int, messageId string) models.Result

func ErrorWithMsg

func ErrorWithMsg(code int, messageId, msg string) models.Result

func Format

func Format(messageId string, args ...interface{}) string

Format 格式化数据,messageId对应的内容为带{}的模板

func GetAppXLangStringsAll

func GetAppXLangStringsAll(appName string) (map[string]string, error)

func GetAppXLangVersion

func GetAppXLangVersion(appName string) (string, error)

func GetXLangString

func GetXLangString(stringId, lang string) string

func Init

func Init()

func ParamError

func ParamError(param string) models.Result

func ParamLostError

func ParamLostError(param string) models.Result

func String

func String(messageId string) string

String 将messageId根据当前协程X-Lang参数转换成当前语言字符串

func Success

func Success(data interface{}) models.Result

func SuccessWithPage

func SuccessWithPage(data interface{}, count, index, size, total int) models.Result

Types

This section is empty.

Jump to

Keyboard shortcuts

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