MCPcopy
hub / github.com/chubin/wttr.in / Localizer

Interface Localizer

internal/localization/localizer.go:13–27  ·  view source on GitHub ↗

Localizer provides localized strings for a specific language.

Source from the content-addressed store, hash-verified

11
12// Localizer provides localized strings for a specific language.
13type Localizer interface {
14 // Text returns a translated string by key.
15 // It should be used for messages, captions, v1/v2 keys, etc.
16 // Do NOT pass condition codes here.
17 Text(lang, key string) string
18
19 // Condition returns translated weather condition by numeric code.
20 Condition(lang string, code int) string
21
22 // ConditionByName returns translated condition by its English name.
23 ConditionByName(lang, englishName string) string
24
25 // File returns raw file content (help.txt, etc.)
26 File(lang, name string) (string, error)
27}
28
29// LocalizeFunc is a language-bound text localization function.
30type LocalizeFunc func(key string) string

Callers 14

NewFunction · 0.65
textualInformationFunction · 0.65
addFrameFunction · 0.65
drawDateFunction · 0.65
RenderMethod · 0.65
printDayMethod · 0.65
formatDateMethod · 0.65
processLogLinesFunction · 0.65
TranslateWeatherFunction · 0.65
NewFunction · 0.65
TranslateWeatherFunction · 0.65
NewFunction · 0.65

Implementers 1

Bundleinternal/translate/bundle.go

Calls

no outgoing calls

Tested by

no test coverage detected