languages

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2019 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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