i18n

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(ctx context.Context, key string) string

Get 获取语言对应的配置项,从 context.Context 中获取上下文语言。

func LoadLanguage

func LoadLanguage(filename string) error

LoadLanguage 加载语言文件。

func Register

func Register(language string, data *conf.Properties) error

Register 注册语言配置表。

func Resolve

func Resolve(ctx context.Context, s string) (string, error)

Resolve 获取语言对应的配置项,从 context.Context 中获取上下文语言。

func SetDefaultLanguage

func SetDefaultLanguage(language string)

SetDefaultLanguage 设置默认语言。

func SetLanguage

func SetLanguage(ctx context.Context, language string) error

SetLanguage 设置上下文语言。

Types

This section is empty.

Jump to

Keyboard shortcuts

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