import "golang.org/x/text/message"
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/text/12750-localization and its corresponding proposal issue https://golang.org/issues/12750.
SetString calls SetString on the default Catalog.
type Catalog struct {
// contains filtered or unexported fields
}
A Catalog holds translations for messages for supported languages.
DefaultCatalog is used by SetString.
Languages returns a slice of all languages for which the Catalog contains variants.
Printer creates a Printer that uses c.
SetString sets the translation for the given language and key.
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.
NewPrinter returns a Printer that formats messages tailored to language t.
Fprint is like fmt.Fprint, but using language-specific formatting.
Fprintf is like fmt.Fprintf, but using language-specific formatting.
Fprintln is like fmt.Fprintln, but using language-specific formatting.
Print is like fmt.Print, but using language-specific formatting.
Printf is like fmt.Printf, but using language-specific formatting.
Println is like fmt.Println, but using language-specific formatting.
Sprint is like fmt.Sprint, but using language-specific formatting.
Sprintf is like fmt.Sprintf, but using language-specific formatting.
Sprintln is like fmt.Sprintln, but using language-specific formatting.
type Reference interface { }
A Reference is a string or a message reference.
Key creates a message Reference for a message where the given id is used for message lookup and the fallback is returned when no matches are found.
Package message imports 7 packages (graph). Updated 6 days ago. Refresh now. Tools for package owners.