localizer

package
v0.8.69 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Localizer

type Localizer interface {
	Localize(bucket string, key string) (string, error)
	LoadBucketFromFile(bucket string, path string, append bool)
	LoadBucketFromMap(bucket string, pairs map[string]string, append bool)
	SaveBucketToFile(bucket string, path string)
	PushBucketToSource(bucket string) (err error)
	PullBucketFromSource(bucket string, append bool) (err error)
}

type PoeditorSource

type PoeditorSource struct {
	// contains filtered or unexported fields
}

func NewPoeditorSource

func NewPoeditorSource(apiKey string, projectId string, language string) *PoeditorSource

func (*PoeditorSource) Pull

func (l *PoeditorSource) Pull() (pairs map[string]string, err error)

func (*PoeditorSource) Push

func (l *PoeditorSource) Push(terms []string) (err error)

type SimpleLocalizer

type SimpleLocalizer struct {
	// contains filtered or unexported fields
}

func NewSimpleLocalizer

func NewSimpleLocalizer(source *PoeditorSource) *SimpleLocalizer

func (*SimpleLocalizer) LoadBucketFromFile

func (l *SimpleLocalizer) LoadBucketFromFile(bucket string, path string, append bool)

func (*SimpleLocalizer) LoadBucketFromMap

func (l *SimpleLocalizer) LoadBucketFromMap(bucket string, pairs map[string]string, append bool)

func (*SimpleLocalizer) Localize

func (l *SimpleLocalizer) Localize(bucket string, key string) (string, error)

func (*SimpleLocalizer) PullBucketFromSource

func (l *SimpleLocalizer) PullBucketFromSource(bucket string, append bool) (err error)

func (*SimpleLocalizer) PushBucketToSource

func (l *SimpleLocalizer) PushBucketToSource(bucket string) (err error)

func (*SimpleLocalizer) SaveBucketToFile

func (l *SimpleLocalizer) SaveBucketToFile(bucket string, path string)

type Source

type Source interface {
	Push([]string) error
	Pull() (map[string]string, error)
}

Jump to

Keyboard shortcuts

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