kubernetes/vendor/golang.org/x/text/feature/plural/message.go

type Interface

// Selectf returns the first case for which its selector is a match for the
// arg-th substitution argument to a formatting call, formatting it as indicated
// by format.
//
// The cases argument are pairs of selectors and messages. Selectors are of type
// string or Form. Messages are of type string or catalog.Message. A selector
// matches an argument if:
//   - it is "other" or Other
//   - it matches the plural form of the argument: "zero", "one", "two", "few",
//     or "many", or the equivalent Form
//   - it is of the form "=x" where x is an integer that matches the value of
//     the argument.
//   - it is of the form "<x" where x is an integer that is larger than the
//     argument.
//
// The format argument determines the formatting parameters for which to
// determine the plural form. This is especially relevant for non-integer
// values.
//
// The format string may be "", in which case a best-effort attempt is made to
// find a reasonable representation on which to base the plural form. Examples
// of format strings are:
//   - %.2f   decimal with scale 2
//   - %.2e   scientific notation with precision 3 (scale + 1)
//   - %d     integer
func Selectf(arg int, format string, cases ...interface{}

type parser

func (p *parser) Format(s fmt.State, verb rune) {}

type message

const kindDefault

const kindScale

const kindScientific

const kindPrecision

var handle

func (m *message) Compile(e *catmsg.Encoder) error {}

func compileSelector(e *catmsg.Encoder, valid []Form, selector interface{}

func execute(d *catmsg.Decoder) bool {}