MCPcopy
hub / github.com/apache/answer / Translate

Function Translate

plugin/plugin.go:222–224  ·  view source on GitHub ↗

Translate translates the key to the current language of the context

(ctx *GinContext, key string)

Source from the content-addressed store, hash-verified

220
221// Translate translates the key to the current language of the context
222func Translate(ctx *GinContext, key string) string {
223 return translator.Tr(handler.GetLangByCtx(ctx), key)
224}
225
226// TranslateWithData translates the key to the language with data
227func TranslateWithData(lang i18n.Language, key string, data any) string {

Callers 1

MakeTranslatorFunction · 0.85

Calls 2

TrFunction · 0.92
GetLangByCtxFunction · 0.92

Tested by

no test coverage detected