Documentation
¶
Overview ¶
Package extract 提供从 Go 源码中提取本地化内容的功能
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Extract ¶
func Extract(ctx context.Context, lang, root string, r bool, log Logger, f ...string) (*message.Messages, error)
Extract 提取本地化内容
lang 代码的文本所使用的语言; root 需要提取本地化内容的源码目录; f 表示被用于本地化的函数,所有 f 指定的函数,其参数都将被提取为本地化的内容。 f 每个元素的格式为 mod/path.func,mod/path 为包的导出路径,func 为函数名。 f 的函数签名应该始终与 [localeutil.Phrase] 相同;
Types ¶
Click to show internal directories.
Click to hide internal directories.