i18n

package
v0.0.0-...-6410feb Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func P

func P(tag language.Tag, id string, a ...interface{}) string

Types

type ITable

type ITable interface {
	Lookup(ctx context.Context, key string) string
}

type Table

type Table map[string]TableEntry

func (Table) Lookup

func (tbl Table) Lookup(ctx context.Context, key string) string

func (Table) LookupByLang

func (tbl Table) LookupByLang(lang language.Tag, key string) string

func (Table) Set

func (tbl Table) Set(k string, te TableEntry)

type TableEntry

type TableEntry map[language.Tag]string

func NewTableEntry

func NewTableEntry() TableEntry

func (TableEntry) CN

func (te TableEntry) CN(v string) TableEntry

func (TableEntry) EN

func (te TableEntry) EN(v string) TableEntry

func (TableEntry) Lookup

func (te TableEntry) Lookup(ctx context.Context) (string, bool)

type Tag

type Tag = language.Tag
var (
	I18N_TAG_CHINESE Tag = Tag(language.Chinese)
	I18N_TAG_ENGLISH Tag = Tag(language.English)
)

Jump to

Keyboard shortcuts

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