Documentation ¶
Overview ¶
Package locale 提供了一个本地化翻译服务。
Index ¶
- Constants
- func Fprint(w io.Writer, v ...interface{}) (int, error)
- func Fprintf(w io.Writer, key message.Reference, v ...interface{}) (int, error)
- func Fprintln(w io.Writer, v ...interface{}) (int, error)
- func Init() error
- func NewPrinter(tag language.Tag) *message.Printer
- func Print(v ...interface{}) (int, error)
- func Printf(key string, v ...interface{}) (int, error)
- func Println(v ...interface{}) (int, error)
- func Sprint(v ...interface{}) string
- func Sprintf(key message.Reference, v ...interface{}) string
- func Sprintln(v ...interface{}) string
Constants ¶
View Source
const ( SyntaxError = "在[%v:%v]出现语法错误[%v]" // app/errors.go:23 OptionsError = "配置文件[%v]中配置项[%v]错误[%v]" // app/errors.go:27 // 与 flag 包相关的处理 FlagUsage = `` /* 144-byte string literal not displayed */ FlagHUsage = "显示帮助信息" FlagVUsage = "显示版本信息" FlagLanguagesUsage = "显示所有支持的语言" FlagGUsage = "创建一个默认的配置文件" FlagEncodingsUsage = "显示支持的编码方式" FlagWDUsage = "指定工作目录,默认为当前目录" FlagPprofUsage = "指定一种调试输出类型,可以为 %s 或是 %s" FlagVersionBuildWith = "%v %v build with %v\n" FlagVersionCommitHash = "commit hash %v\n" FlagSupportedLanguages = "目前支持以下语言 %v\n" FlagSupportedEncodings = "目前支持以下编码 %v\n" FlagConfigWritedSuccess = "配置内容成功写入 %v" FlagPprofWritedSuccess = "pprof 的相关数据已经写入到 %v" FlagInvalidPprrof = "无效的 pprof 参数" VersionInCompatible = "当前程序与配置文件中指定的版本号不兼容" Complete = "完成!文档保存在:%v,总用时:%v" // 错误信息,可能在地方用到 ErrRequired = "不能为空" ErrInvalidFormat = "格式不正确" ErrDirNotExists = "目录不存在" ErrMkdirError = "创建目录时发生以下错误:%v" ErrInvalidBlockType = "无效的 block.Type 值:%v" ErrUnsupportedInputLang = "无效的输入语言:%v" ErrNotFoundEndFlag = "找不到结束符号" ErrNotFoundSupportedLang = "该目录下没有支持的语言文件" ErrUnknownTag = "不认识的标签:%v" ErrDuplicateTag = "重复的标签:%v" ErrSuccessNotEmpty = vars.APISuccess + " 不能为空" ErrTagArgTooMuch = "标签:%v 指定了太多的参数" ErrTagArgNotEnough = "标签:%v 参数不够" ErrSecondArgMustURL = vars.APILicense + " 第二个参数必须为 URL" ErrUnsupportedEncoding = "不支持的编码方式:%v" // logs InfoPrefix = "[INFO] " WarnPrefix = "[WARN] " ErrorPrefix = "[ERRO] " )
各个语言需要翻译的所有字符串
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.