languages

package
v1.2.0-docker Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LangData

type LangData struct {
	Name         string
	Code         string
	Contributors string
	Incomplete   bool
}

LangData is the data contained in a language file.

type Manager

type Manager struct {
	Languages map[string]LangData
	// contains filtered or unexported fields
}

Manager manages our languages and provides translation abilities.

func NewManager

func NewManager(enabled bool, path string, defaultLang string) (lm *Manager, err error)

NewManager returns a new Manager.

func (*Manager) CapValue added in v1.1.0

func (lm *Manager) CapValue() string

func (*Manager) Codes

func (lm *Manager) Codes(codes []string) []string

Codes returns the proper language codes for the given casefolded language codes.

func (*Manager) Count

func (lm *Manager) Count() int

Count returns how many languages we have.

func (*Manager) Default

func (lm *Manager) Default() []string

Default returns the default languages.

func (*Manager) Enabled added in v1.2.0

func (lm *Manager) Enabled() bool

Enabled returns whether translation is enabled.

func (*Manager) Translate

func (lm *Manager) Translate(languages []string, originalString string) string

Translate returns the given string, translated into the given language.

func (*Manager) Translators

func (lm *Manager) Translators() []string

Translators returns the languages we have and the translators.

Jump to

Keyboard shortcuts

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