i18n

package
v0.0.0-...-f5ca297 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(packName string, paths []string, outFile string) error

Extract messages

func Fprintf

func Fprintf(w io.Writer, key string, args ...interface{}) (n int, err error)

Fprintf is like fmt.Fprintf, but using language-specific formatting.

func Generate

func Generate(pkgName string, paths []string, outFile string) error

Generate catalog.go

func Printf

func Printf(format string, args ...interface{})

Printf is like fmt.Printf, but using language-specific formatting.

func SetLang

func SetLang(lang interface{})

SetLang set language

func Sprintf

func Sprintf(format string, args ...interface{}) string

Sprintf is like fmt.Sprintf, but using language-specific formatting.

func Update

func Update(srcFile string, destFile string) error

Update messages

Types

type Message

type Message map[string]string

Message is translation message

type PluralRule

type PluralRule struct {
	Pos   int
	Expr  string
	Value int
	Text  string
}

PluralRule is Plural rule

func Plural

func Plural(cases ...interface{}) []PluralRule

Plural is Plural function

type Printer

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

Printer is printer

func GetPrinter

func GetPrinter() *Printer

GetPrinter

func NewPrinter

func NewPrinter(lang interface{}) *Printer

NewPrinter is new printer

func (*Printer) Fprintf

func (p *Printer) Fprintf(w io.Writer, key string, a ...interface{}) (n int, err error)

Fprintf is like fmt.Fprintf, but using language-specific formatting.

func (*Printer) Printf

func (p *Printer) Printf(format string, args ...interface{})

Printf is like fmt.Printf, but using language-specific formatting.

func (*Printer) Sprintf

func (p *Printer) Sprintf(format string, args ...interface{}) string

Sprintf is like fmt.Sprintf, but using language-specific formatting.

func (*Printer) String

func (p *Printer) String() string

String is lang

Jump to

Keyboard shortcuts

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