Documentation
¶
Index ¶
Constants ¶
View Source
const ( English = "en" SimplifiedChinese = "zh-CN" )
Variables ¶
This section is empty.
Functions ¶
func Detect ¶
Detect chooses a locale using this priority: explicit, VMFLOW_LANG, configured, English.
func SupportedLocales ¶
func SupportedLocales() []string
SupportedLocales returns the canonical locale codes accepted by vmflow.
Types ¶
type Translator ¶
type Translator struct {
// contains filtered or unexported fields
}
Translator resolves stable message keys for one locale. It is immutable after construction and can be passed safely to independent CLI or TUI runs.
func New ¶
func New(locale string) *Translator
New creates a translator for locale. Unsupported locales use English.
func (*Translator) Locale ¶
func (t *Translator) Locale() string
Locale returns the canonical locale code used by this translator.
func (*Translator) T ¶
func (t *Translator) T(key string) string
T returns the localized value for key, falling back to English and then key.
Click to show internal directories.
Click to hide internal directories.