i18n

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByCode

func ByCode(lang Lang, code err_code.Code, args []string) string

func ByCodeOrKey

func ByCodeOrKey(lang Lang, code err_code.Code, key string, args []string) string

func ByKey

func ByKey(lang Lang, key string, args []string) string

func Init

func Init(cfg Config) error

Types

type Config

type Config struct {
	Type        string         `json:"type" mapstructure:"type"`
	XlsxPath    string         `json:"xlsxPath" mapstructure:"xlsxPath"`
	XlsxSheets  []string       `json:"xlsxSheets" mapstructure:"xlsxSheets"`
	JsonlPath   string         `json:"jsonlPath" mapstructure:"jsonlPath"`
	Langs       []LangCodeName `json:"langs" mapstructure:"langs"`
	DefaultLang string         `json:"defaultLang" mapstructure:"defaultLang"`
}

type Lang

type Lang string

func DefaultLang

func DefaultLang() Lang

type LangCodeName

type LangCodeName struct {
	// https://i18ns.com/languagecode.html
	Code string `json:"code" mapstructure:"code"`
	Name string `json:"name" mapstructure:"name"`
}

Jump to

Keyboard shortcuts

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