locale

package
v1.0.46 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvailableLanguages

func AvailableLanguages() map[string]string

AvailableLanguages returns the list of available languages.

func LoadCatalogMessages

func LoadCatalogMessages() error

LoadCatalogMessages loads and parses all translations encoded in JSON.

Types

type Printer

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

Printer converts translation keys to language-specific strings.

func NewPrinter

func NewPrinter(language string) *Printer

NewPrinter creates a new Printer.

func (*Printer) Plural

func (p *Printer) Plural(key string, n int, args ...interface{}) string

Plural returns the translation of the given key by using the language plural form.

func (*Printer) Printf

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

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

Jump to

Keyboard shortcuts

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