translation

package
v0.0.2-beta1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadTranslations

func LoadTranslations(i18nPath string)

func RegisterTemplateFunc

func RegisterTemplateFunc(name string, fn interface{})

func SetDefaultLocale

func SetDefaultLocale(l lang.Tag)

func Stringer

func Stringer(v interface{}) string

Types

type LocaleManager

type LocaleManager struct {
}

func DefaultLocaleManager

func DefaultLocaleManager() *LocaleManager

type Message

type Message struct {
	ID   string `json:"id"`
	Text string `json:"text"`
	// contains filtered or unexported fields
}

func (Message) Format

func (m Message) Format(v interface{}) string

func (Message) FormatTranslate

func (m Message) FormatTranslate(l lang.Tag, v interface{}) string

func (Message) String

func (m Message) String() string

func (Message) Translate

func (m Message) Translate(l lang.Tag) string

type TemplateData

type TemplateData map[string]interface{}

Jump to

Keyboard shortcuts

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