i18n

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type I18n

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

func New

func New(opt ...Opt) *I18n

func (*I18n) ChangeLocale

func (i *I18n) ChangeLocale(locale string)

func (*I18n) GetPrinterByLocale

func (i *I18n) GetPrinterByLocale(localeName string) (*message.Printer, error)

func (*I18n) LocalesInit

func (i *I18n) LocalesInit() error

func (*I18n) TrPrint

func (i *I18n) TrPrint(source string) (int, error)

TrPrint translate and print the source string

func (*I18n) TrPrintln

func (i *I18n) TrPrintln(source string) (int, error)

TrPrintln translate and println the source string

func (*I18n) Trf

func (i *I18n) Trf(source string, param ...interface{}) string

Trf translate the source string with the given parameters

func (*I18n) TrfPrint

func (i *I18n) TrfPrint(writer io.Writer, source string) (int, error)

TrfPrint translate and print the source string with the given writer

func (*I18n) TrfPrintln

func (i *I18n) TrfPrintln(writer io.Writer, source string) (int, error)

TrfPrintln translate and println the source string with the given writer

func (*I18n) TrfWriter

func (i *I18n) TrfWriter(writer io.Writer, source string, param ...interface{}) (int, error)

TrfWriter translate the source string with the given parameters and write it to the writer

type Opt

type Opt func(i *I18n)

func DefaultFallBackLocale

func DefaultFallBackLocale(locale string) Opt

func DefaultLocale

func DefaultLocale(locale string) Opt

func LocalesDir

func LocalesDir(dir string) Opt

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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