i18n_manager

package module
v0.0.0-...-9b567fe Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2025 License: MIT Imports: 6 Imported by: 0

README

i18n_manager

介绍

go-i18n管理库,更简单的使用go-i18n

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BundleHandleFunc

type BundleHandleFunc func(bundle *i18n.Bundle) error

type I18nManager

type I18nManager struct {
	// contains filtered or unexported fields
}

func NewI18nManager

func NewI18nManager(defaultLang, fallbackLang string, handleFuncs ...BundleHandleFunc) (*I18nManager, error)

func (*I18nManager) LoadTomlMessageFileFs

func (i *I18nManager) LoadTomlMessageFileFs(tomlFs embed.FS) error

func (*I18nManager) SetLanguage

func (i *I18nManager) SetLanguage(lang ...string)

func (*I18nManager) T

func (i *I18nManager) T(msgId string, tmplData map[string]any) (string, error)

func (*I18nManager) Tn

func (i *I18nManager) Tn(msgId string, count int64, tmplData map[string]any) (string, error)

Jump to

Keyboard shortcuts

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