| 1 | // Copyright 2015 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | // Package format contains types for defining language-specific formatting of |
| 6 | // values. |
| 7 | // |
| 8 | // This package is internal now, but will eventually be exposed after the API |
| 9 | // settles. |
| 10 | package formatscip-go gomod golang.org/x/text . `golang.org/x/text/internal/format`/ // import "golang.org/x/text/internal/format" |
| 11 | |
| 12 | import ( |
| 13 | "fmtscip-go gomod github.com/golang/go/src go1.25.0 fmt/" |
| 14 | |
| 15 | "golang.org/x/text/languagescip-go gomod golang.org/x/text . `golang.org/x/text/language`/" |
| 16 | ) |
| 17 | |
| 18 | // State represents the printer state passed to custom formatters. It provides |
| 19 | // access to the fmt.State interface and the sentence and language-related |
| 20 | // context. |
| 21 | type Statescip-go gomod golang.org/x/text . `golang.org/x/text/internal/format`/State# interface { |
| 22 | fmtscip-go gomod github.com/golang/go/src go1.25.0 fmt/.Statescip-go gomod github.com/golang/go/src go1.25.0 fmt/State# |
| 23 | |
| 24 | // Language reports the requested language in which to render a message. |
| 25 | Languagescip-go gomod golang.org/x/text . `golang.org/x/text/internal/format`/State#Language.() languagescip-go gomod golang.org/x/text . `golang.org/x/text/language`/.Tagscip-go gomod golang.org/x/text . `golang.org/x/text/language`/Tag# |
| 26 | |
| 27 | // TODO: consider this and removing rune from the Format method in the |
| 28 | // Formatter interface. |
| 29 | // |
| 30 | // Verb returns the format variant to render, analogous to the types used |
| 31 | // in fmt. Use 'v' for the default or only variant. |
| 32 | // Verb() rune |
| 33 | |
| 34 | // TODO: more info: |
| 35 | // - sentence context such as linguistic features passed by the translator. |
| 36 | } |
| 37 | |
| 38 | // Formatter is analogous to fmt.Formatter. |
| 39 | type Formatterscip-go gomod golang.org/x/text . `golang.org/x/text/internal/format`/Formatter# interface { |
| 40 | Formatscip-go gomod golang.org/x/text . `golang.org/x/text/internal/format`/Formatter#Format.(state Statescip-go gomod golang.org/x/text . `golang.org/x/text/internal/format`/State#, verb rune) |
| 41 | } |