MCPcopy
hub / github.com/kubernetes/kubectl / T

Function T

pkg/util/i18n/i18n.go:202–209  ·  view source on GitHub ↗

T translates a string, possibly substituting arguments into it along the way. If len(args) is > 0, args1 is assumed to be the plural value and plural translation is used.

(defaultValue string, args ...int)

Source from the content-addressed store, hash-verified

200// the way. If len(args) is > 0, args1 is assumed to be the plural value
201// and plural translation is used.
202func T(defaultValue string, args ...int) string {
203 lazyLoadTranslations()
204 if len(args) == 0 {
205 return gettext.PGettext("", defaultValue)
206 }
207 return fmt.Sprintf(gettext.PNGettext("", defaultValue, defaultValue+".plural", args[0]),
208 args[0])
209}
210
211// Errorf produces an error with a translated error string.
212// Substitution is performed via the `T` function above, following

Callers 15

NewKubectlCommandFunction · 0.92
NewCmdAlphaFunction · 0.92
logs.goFile · 0.92
NewCmdLogsFunction · 0.92
AddFlagsMethod · 0.92
completion.goFile · 0.92
NewCmdCompletionFunction · 0.92
scale.goFile · 0.92
NewCmdScaleFunction · 0.92
GetPluginCommandGroupFunction · 0.92
registerPluginCommandsFunction · 0.92
plugin.goFile · 0.92

Calls 1

lazyLoadTranslationsFunction · 0.85