i18n

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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