languages

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: MIT Imports: 4 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
	Translations map[string]string
}

LangData is the data contained in a language file.

type Manager

type Manager struct {
	sync.RWMutex
	Info map[string]LangData
	// contains filtered or unexported fields
}

Manager manages our languages and provides translation abilities.

func NewManager

func NewManager(defaultLang string, languageData map[string]LangData) *Manager

NewManager returns a new Manager.

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) 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