i18n

package
v0.0.0-...-2ef9421 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2015 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = "en-US"

Functions

This section is empty.

Types

type Backend

type Backend interface {
	LoadTranslations() []*Translation
	SaveTranslation(*Translation) error
	DeleteTranslation(*Translation) error
}

type I18n

type I18n struct {
	Backends     []Backend
	Translations map[string]map[string]*Translation
	// contains filtered or unexported fields
}

func New

func New(backends ...Backend) *I18n

func (*I18n) AddTranslation

func (i18n *I18n) AddTranslation(translation *Translation)

func (*I18n) ConfigureQorResource

func (i18n *I18n) ConfigureQorResource(res *admin.Resource)

func (*I18n) Default

func (i18n *I18n) Default(value string) admin.I18n

func (*I18n) DeleteTranslation

func (i18n *I18n) DeleteTranslation(translation *Translation) error

func (I18n) ResourceName

func (I18n) ResourceName() string

func (*I18n) SaveTranslation

func (i18n *I18n) SaveTranslation(translation *Translation) error

func (*I18n) Scope

func (i18n *I18n) Scope(scope string) admin.I18n

func (*I18n) T

func (i18n *I18n) T(locale, key string, args ...interface{}) string

type Translation

type Translation struct {
	Key     string
	Locale  string
	Value   string
	Backend Backend
}

Directories

Path Synopsis
backends

Jump to

Keyboard shortcuts

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