Documentation
¶
Overview ¶
Package i18n 提供国际化支持
Index ¶
- func GetDefaultLanguage() string
- func GetDefaultLanguageContext(ctx context.Context) string
- func GetSupportedLanguages() []string
- func GetSupportedLanguagesContext(ctx context.Context) []string
- func Setup(config Config, fsys fs.FS) error
- func SetupWithEmbedFS(config Config, embedFS embed.FS, dir string) error
- func T(messageID string, lang string, args ...any) string
- func TContext(ctx context.Context, messageID string, lang string, args ...any) string
- func Translate(messageID string, lang string, args map[string]any) string
- func TranslateContext(ctx context.Context, messageID string, lang string, args map[string]any) string
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultLanguageContext ¶
GetDefaultLanguageContext 使用上下文获取默认语言
func GetSupportedLanguagesContext ¶
GetSupportedLanguagesContext 使用上下文获取支持的语言列表
func SetupWithEmbedFS ¶
SetupWithEmbedFS 使用嵌入文件系统初始化i18n服务
Types ¶
Click to show internal directories.
Click to hide internal directories.