i18n

package
v0.0.0-...-ea25219 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = "en-US"

Functions

func GetAvailableLocales

func GetAvailableLocales(req *http.Request, currentUser qor.CurrentUser) []string

func GetEditableLocales

func GetEditableLocales(req *http.Request, currentUser qor.CurrentUser) []string

Types

type AvailableLocalesInterface

type AvailableLocalesInterface interface {
	AvailableLocales() []string
}

type Backend

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

type EditableLocalesInterface

type EditableLocalesInterface interface {
	EditableLocales() []string
}

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

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

func (*I18n) DeleteTransaltion

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

func (*I18n) InjectQorAdmin

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

func (*I18n) SaveTransaltion

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

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 I18nController

type I18nController struct {
	*I18n
}

func (*I18nController) Index

func (controller *I18nController) Index(context *admin.Context)

func (*I18nController) Update

func (controller *I18nController) Update(context *admin.Context)

type Translation

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

type ViewableLocalesInterface

type ViewableLocalesInterface interface {
	ViewableLocales() []string
}

Directories

Path Synopsis
backends

Jump to

Keyboard shortcuts

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