extract

package
v0.17.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 15 Imported by: 1

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

type Logger

type Logger interface {
	Print(...any)
	Printf(string, ...any)
}

Logger 日志输出接口

Jump to

Keyboard shortcuts

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