Documentation ¶
Overview ¶
Package ttenn provides a simple way to translate text.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type InMemoryOption ¶
type InMemoryOption func(*InMemoryTranslator) error
InMemoryOption is a function that configures a InMemoryTranslator.
func WithDefaultLanguage ¶
func WithDefaultLanguage(defaultLanguage language.Tag) InMemoryOption
WithDefaultLanguage sets the default language of an InMemoryTranslator.
func WithJSON ¶
func WithJSON(r io.Reader) InMemoryOption
WithJSON uses the given JSON file to configure the languages and translations of an InMemoryTranslator.
type InMemoryTranslator ¶
type InMemoryTranslator struct {
// contains filtered or unexported fields
}
InMemoryTranslator implements Translator.
func NewInMemory ¶
func NewInMemory(options ...InMemoryOption) (*InMemoryTranslator, error)
NewInMemory configures a new InMemoryTranslator.
Click to show internal directories.
Click to hide internal directories.