l10n

package
v0.0.0-...-c3c9c93 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

type Set struct {
	Locale string
	// contains filtered or unexported fields
}

Set represents a language set.

func New

func New(src Source) (*Set, error)

New initializes a new language set.

func (*Set) Tfunc

func (s *Set) Tfunc() (bundle.TranslateFunc, error)

Tfunc returns a translation function.

type Source

type Source interface {
	// FetchLanguage receives the name of a language and must return the
	// translation dictionary (in JSON) for that language.
	FetchLanguage(lang string) ([]byte, error)
	// Languages returns a list of language tags, in order of user preference.
	Languages() ([]string, error)
}

Source is a language information source.

Jump to

Keyboard shortcuts

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