utils

package
v1.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseInput

func ParseInput(input, trigger string) (string, []string, []string)

ParseInput pares a given input and tries to extract the poll question and poll options

Types

type Bundle added in v1.5.0

type Bundle struct {
	*i18n.Bundle
	// contains filtered or unexported fields
}

Bundle stores a set ot messages and translates messages.

func InitBundle added in v1.5.0

func InitBundle(api plugin.API, path string) (*Bundle, error)

InitBundle loads all localization files in i18n into a bundle and return this

func (*Bundle) GetServerLocalizer added in v1.5.0

func (b *Bundle) GetServerLocalizer() *i18n.Localizer

GetServerLocalizer returns a localizer that localizes in the server default client locale

func (*Bundle) GetUserLocalizer added in v1.5.0

func (b *Bundle) GetUserLocalizer(userID string) *i18n.Localizer

GetUserLocalizer returns a localizer that localizes in the users locale

func (*Bundle) LocalizeDefaultMessage added in v1.5.0

func (b *Bundle) LocalizeDefaultMessage(l *i18n.Localizer, m *i18n.Message) string

LocalizeDefaultMessage localizer the provided message

func (*Bundle) LocalizeErrorMessage added in v1.5.0

func (b *Bundle) LocalizeErrorMessage(l *i18n.Localizer, m *ErrorMessage) string

LocalizeErrorMessage localizer the provided error message

func (*Bundle) LocalizeWithConfig added in v1.5.0

func (b *Bundle) LocalizeWithConfig(l *i18n.Localizer, lc *i18n.LocalizeConfig) string

LocalizeWithConfig localizer the provided localize config

type ErrorMessage added in v1.5.0

type ErrorMessage struct {
	Message *i18n.Message
	Data    map[string]interface{}
}

ErrorMessage contains error messsage for a user that can be localized. It should not be wrapped and instead always returned.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL