locale

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package locale 用于提供本地语言包处理接口定义和快捷调用入口

Index

Constants

View Source
const Dash = "-"

Dash 是保留的语言包目录名称

Variables

This section is empty.

Functions

func L

func L(catalog, key, reserved string, args ...interface{}) string

L 返回指定预演目录中指定key的语言文本,当无法找到指定文本时使用reserved作为代替文本

func SetLPack

func SetLPack(pack ILPack)

SetLPack 设置当前正在使用的语言包

Types

type ILPack

type ILPack interface {
	// Localize 用于输出当前语言包下指定的目录中的指定key的语言文本
	Localize(catalog, key, reserved string, args ...interface{}) string
}

ILPack 定义一个语言包的行为接口

Jump to

Keyboard shortcuts

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