Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AvailableLanguages = map[string]string{
"de_DE": "Deutsch",
"el_EL": "Ελληνικά",
"en_US": "English",
"es_ES": "Español",
"fi_FI": "Suomi",
"fr_FR": "Français",
"hi_IN": "हिन्दी",
"id_ID": "Bahasa Indonesia",
"it_IT": "Italiano",
"ja_JP": "日本語",
"nan_Latn_pehoeji": "Pe̍h-ōe-jī",
"nl_NL": "Nederlands",
"pl_PL": "Polski",
"pt_BR": "Português Brasileiro",
"ro_RO": "Română",
"ru_RU": "Русский",
"tr_TR": "Türkçe",
"uk_UA": "Українська",
"zh_CN": "简体中文",
"zh_TW": "繁體中文",
}
AvailableLanguages is the list of available languages.
Functions ¶
This section is empty.
Types ¶
type LocalizedError ¶ added in v2.0.51
type LocalizedError struct {
// contains filtered or unexported fields
}
func NewLocalizedError ¶ added in v2.0.51
func NewLocalizedError(translationKey string, translationArgs ...any) *LocalizedError
func (*LocalizedError) Error ¶ added in v2.0.51
func (v *LocalizedError) Error() error
func (*LocalizedError) String ¶ added in v2.0.51
func (v *LocalizedError) String() string
func (*LocalizedError) Translate ¶ added in v2.0.51
func (v *LocalizedError) Translate(language string) string
type LocalizedErrorWrapper ¶ added in v2.0.51
type LocalizedErrorWrapper struct {
// contains filtered or unexported fields
}
func NewLocalizedErrorWrapper ¶ added in v2.0.51
func NewLocalizedErrorWrapper(originalErr error, translationKey string, translationArgs ...any) *LocalizedErrorWrapper
func (*LocalizedErrorWrapper) Error ¶ added in v2.0.51
func (l *LocalizedErrorWrapper) Error() error
func (*LocalizedErrorWrapper) Translate ¶ added in v2.0.51
func (l *LocalizedErrorWrapper) Translate(language string) string
type Printer ¶
type Printer struct {
// contains filtered or unexported fields
}
Printer converts translation keys to language-specific strings.
func NewPrinter ¶
NewPrinter creates a new Printer instance for the given language.
Click to show internal directories.
Click to hide internal directories.