Documentation ¶
Index ¶
- type Catalog
- type Dictionary
- type TranslatedLogBuilder
- func (tlb *TranslatedLogBuilder) Any(key string, value any) logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Bool(key string, value bool) logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Bytes(key string, value []byte) logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Err(err error) logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Float32(key string, value float32) logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Float64(key string, value float64) logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Int(key string, value int) logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Int16(key string, value int16) logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Int32(key string, value int32) logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Int64(key string, value int64) logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Int8(key string, value int8) logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Send()
- func (tlb *TranslatedLogBuilder) Str(key string, value string) logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Stringer(key string, value fmt.Stringer) logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Timestamp() logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Uint(key string, value uint) logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Uint16(key string, value uint16) logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Uint32(key string, value uint32) logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Uint64(key string, value uint64) logger.LogBuilder
- func (tlb *TranslatedLogBuilder) Uint8(key string, value uint8) logger.LogBuilder
- type TranslatedLogger
- func (tl *TranslatedLogger) Debug(msg string) logger.LogBuilder
- func (tl *TranslatedLogger) Debugf(format string, args ...any) logger.LogBuilder
- func (tl *TranslatedLogger) Error(msg string) logger.LogBuilder
- func (tl *TranslatedLogger) Errorf(format string, args ...any) logger.LogBuilder
- func (tl *TranslatedLogger) Fatal(msg string) logger.LogBuilder
- func (tl *TranslatedLogger) Fatalf(format string, args ...any) logger.LogBuilder
- func (tl *TranslatedLogger) Info(msg string) logger.LogBuilder
- func (tl *TranslatedLogger) Infof(format string, args ...any) logger.LogBuilder
- func (tl *TranslatedLogger) NoExit()
- func (tl *TranslatedLogger) NoPanic()
- func (tl *TranslatedLogger) Panic(msg string) logger.LogBuilder
- func (tl *TranslatedLogger) Panicf(format string, args ...any) logger.LogBuilder
- func (tl *TranslatedLogger) SetLevel(level logger.LogLevel)
- func (tl *TranslatedLogger) Warn(msg string) logger.LogBuilder
- func (tl *TranslatedLogger) Warnf(format string, args ...any) logger.LogBuilder
- type Translation
- type Translations
- type Translator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
type Catalog map[language.Tag]Dictionary
type Dictionary ¶
type TranslatedLogBuilder ¶
type TranslatedLogBuilder struct { LogBuilder logger.LogBuilder Translator Translator Language language.Tag }
func (*TranslatedLogBuilder) Any ¶
func (tlb *TranslatedLogBuilder) Any(key string, value any) logger.LogBuilder
func (*TranslatedLogBuilder) Bool ¶
func (tlb *TranslatedLogBuilder) Bool(key string, value bool) logger.LogBuilder
func (*TranslatedLogBuilder) Bytes ¶
func (tlb *TranslatedLogBuilder) Bytes(key string, value []byte) logger.LogBuilder
func (*TranslatedLogBuilder) Err ¶
func (tlb *TranslatedLogBuilder) Err(err error) logger.LogBuilder
func (*TranslatedLogBuilder) Float32 ¶
func (tlb *TranslatedLogBuilder) Float32(key string, value float32) logger.LogBuilder
func (*TranslatedLogBuilder) Float64 ¶
func (tlb *TranslatedLogBuilder) Float64(key string, value float64) logger.LogBuilder
func (*TranslatedLogBuilder) Int ¶
func (tlb *TranslatedLogBuilder) Int(key string, value int) logger.LogBuilder
func (*TranslatedLogBuilder) Int16 ¶
func (tlb *TranslatedLogBuilder) Int16(key string, value int16) logger.LogBuilder
func (*TranslatedLogBuilder) Int32 ¶
func (tlb *TranslatedLogBuilder) Int32(key string, value int32) logger.LogBuilder
func (*TranslatedLogBuilder) Int64 ¶
func (tlb *TranslatedLogBuilder) Int64(key string, value int64) logger.LogBuilder
func (*TranslatedLogBuilder) Int8 ¶
func (tlb *TranslatedLogBuilder) Int8(key string, value int8) logger.LogBuilder
func (*TranslatedLogBuilder) Send ¶
func (tlb *TranslatedLogBuilder) Send()
func (*TranslatedLogBuilder) Str ¶
func (tlb *TranslatedLogBuilder) Str(key string, value string) logger.LogBuilder
func (*TranslatedLogBuilder) Stringer ¶
func (tlb *TranslatedLogBuilder) Stringer(key string, value fmt.Stringer) logger.LogBuilder
func (*TranslatedLogBuilder) Timestamp ¶
func (tlb *TranslatedLogBuilder) Timestamp() logger.LogBuilder
func (*TranslatedLogBuilder) Uint ¶
func (tlb *TranslatedLogBuilder) Uint(key string, value uint) logger.LogBuilder
func (*TranslatedLogBuilder) Uint16 ¶
func (tlb *TranslatedLogBuilder) Uint16(key string, value uint16) logger.LogBuilder
func (*TranslatedLogBuilder) Uint32 ¶
func (tlb *TranslatedLogBuilder) Uint32(key string, value uint32) logger.LogBuilder
func (*TranslatedLogBuilder) Uint64 ¶
func (tlb *TranslatedLogBuilder) Uint64(key string, value uint64) logger.LogBuilder
func (*TranslatedLogBuilder) Uint8 ¶
func (tlb *TranslatedLogBuilder) Uint8(key string, value uint8) logger.LogBuilder
type TranslatedLogger ¶
type TranslatedLogger struct { Logger logger.Logger Translator Translator Language language.Tag }
func NewLogger ¶
func NewLogger(l logger.Logger, t Translator, lang language.Tag) *TranslatedLogger
func (*TranslatedLogger) Debug ¶
func (tl *TranslatedLogger) Debug(msg string) logger.LogBuilder
func (*TranslatedLogger) Debugf ¶
func (tl *TranslatedLogger) Debugf(format string, args ...any) logger.LogBuilder
func (*TranslatedLogger) Error ¶
func (tl *TranslatedLogger) Error(msg string) logger.LogBuilder
func (*TranslatedLogger) Errorf ¶
func (tl *TranslatedLogger) Errorf(format string, args ...any) logger.LogBuilder
func (*TranslatedLogger) Fatal ¶
func (tl *TranslatedLogger) Fatal(msg string) logger.LogBuilder
func (*TranslatedLogger) Fatalf ¶
func (tl *TranslatedLogger) Fatalf(format string, args ...any) logger.LogBuilder
func (*TranslatedLogger) Info ¶
func (tl *TranslatedLogger) Info(msg string) logger.LogBuilder
func (*TranslatedLogger) Infof ¶
func (tl *TranslatedLogger) Infof(format string, args ...any) logger.LogBuilder
func (*TranslatedLogger) NoExit ¶
func (tl *TranslatedLogger) NoExit()
func (*TranslatedLogger) NoPanic ¶
func (tl *TranslatedLogger) NoPanic()
func (*TranslatedLogger) Panic ¶
func (tl *TranslatedLogger) Panic(msg string) logger.LogBuilder
func (*TranslatedLogger) Panicf ¶
func (tl *TranslatedLogger) Panicf(format string, args ...any) logger.LogBuilder
func (*TranslatedLogger) SetLevel ¶
func (tl *TranslatedLogger) SetLevel(level logger.LogLevel)
func (*TranslatedLogger) Warn ¶
func (tl *TranslatedLogger) Warn(msg string) logger.LogBuilder
func (*TranslatedLogger) Warnf ¶
func (tl *TranslatedLogger) Warnf(format string, args ...any) logger.LogBuilder
type Translation ¶
type Translations ¶
type Translations struct {
Items []Translation `toml:"translation"`
}
type Translator ¶
func New ¶
func New(cat Catalog) Translator
func NewFromDir ¶
func NewFromDir(dir string) (Translator, error)
func (*Translator) TranslateTo ¶
func (t *Translator) TranslateTo(s string, tag language.Tag) string
Click to show internal directories.
Click to hide internal directories.