Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Stringfy ¶
func Stringfy(s TranslatableStringer) string
func TransformTranslation ¶
Given a string supported by gettext, transform it into something consumable by go-text NOTE: right now what we are looking for it just to prevent go-text of interpreting % by duplicating it, meaning "literal percent". TODO: this function will need to be smarter in order to support positional arguments and pluralization. Please see gitlab issue #245 for more info.
func Translate ¶
func Translate(t Translator, c TranslatableStringer) (string, error)
Types ¶
type DummyTranslator ¶
type DummyTranslator struct{}
func (DummyTranslator) PrettyFormatTime ¶
func (DummyTranslator) PrettyFormatTime(time time.Time) string
type TranslatableStringer ¶
type TranslatableStringer interface { TplString() string Args() []interface{} }
type Translator ¶
type Translators ¶
type Translators interface { Translator(language.Tag) Translator Matcher() language.Matcher }
func New ¶
func New(catalog catalog.Catalog) Translators
Click to show internal directories.
Click to hide internal directories.