middlewares

package
v0.0.0-...-dae8c3a Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const LangPathCommon = "common"

LangPathCommon 公共语言文件路径

View Source
const LangPathDefault = "./locales"

LangPathDefault 默认语言文件路径

Variables

LangDefault 默认语言

Functions

func I18n

func I18n(args ...interface{}) gin.HandlerFunc

I18n 国际化 - 参数: 语言文件路径, 语言列表, 默认语言

func I18nWithLangHandler

func I18nWithLangHandler() gin.HandlerFunc

I18nWithLangHandler 国际化

Types

type LangLoader

type LangLoader struct{}

LangLoader 语言加载器

func (*LangLoader) LoadLangDir

func (ths *LangLoader) LoadLangDir(dirPath string, langName string) (map[string]string, error)

LoadLangDir 加载语言文件 - 读取目录下所有文件

func (*LangLoader) LoadMessage

func (ths *LangLoader) LoadMessage(path string) ([]byte, error)

LoadMessage 加载语言文件 - 读取目录下所有文件 - 加载默认通用语言文件时, 会加载所有语言文件

Jump to

Keyboard shortcuts

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