Documentation ¶
Overview ¶
Package message implements formatted I/O for localized strings with functions analogous to the fmt's print functions.
NOTE: Under construction. See https://golang.org/design/12750-localization and its corresponding proposal issue https://golang.org/issues/12750.
Index ¶
- Variables
- func Set(tag language.Tag, key string, msg ...catalog.Message) error
- func SetString(tag language.Tag, key string, msg string) error
- type Option
- type Printer
- func (p *Printer) Fprint(w io.Writer, a ...interface{}) (n int, err error)
- func (p *Printer) Fprintf(w io.Writer, key Reference, a ...interface{}) (n int, err error)
- func (p *Printer) Fprintln(w io.Writer, a ...interface{}) (n int, err error)
- func (p *Printer) Print(a ...interface{}) (n int, err error)
- func (p *Printer) Printf(key Reference, a ...interface{}) (n int, err error)
- func (p *Printer) Println(a ...interface{}) (n int, err error)
- func (p *Printer) Sprint(a ...interface{}) string
- func (p *Printer) Sprintf(key Reference, a ...interface{}) string
- func (p *Printer) Sprintln(a ...interface{}) string
- type Reference
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultCatalog *catalog.Catalog = defaultCatalog
DefaultCatalog is used by SetString.
Functions ¶
Types ¶
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
A Printer implements language-specific formatted I/O analogous to the fmt package. Only one goroutine may use a Printer at the same time.
func NewPrinter ¶
NewPrinter returns a Printer that formats messages tailored to language t.
Click to show internal directories.
Click to hide internal directories.