yaml

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWithFilesystem

func NewWithFilesystem(fss ...http.FileSystem) i18n.Backend

NewWithFilesystem initializes a backend that reads translation files from an http.FileSystem.

func NewWithWalk

func NewWithWalk(paths ...string) i18n.Backend

NewWithWalk has the same functionality as New but uses filepath.Walk to find all the translation files recursively.

Types

type Backend

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

Backend YAML backend

func New

func New(paths ...string) *Backend

New new YAML backend for I18n

func (*Backend) DeleteTranslation

func (backend *Backend) DeleteTranslation(t *i18n.Translation) error

DeleteTranslation delete translation into YAML backend, not implemented

func (*Backend) LoadTranslations

func (backend *Backend) LoadTranslations() (translations []*i18n.Translation)

LoadTranslations load translations from YAML backend

func (*Backend) LoadYAMLContent

func (backend *Backend) LoadYAMLContent(content []byte) (translations []*i18n.Translation, err error)

LoadYAMLContent load YAML content

func (*Backend) SaveTranslation

func (backend *Backend) SaveTranslation(t *i18n.Translation) error

SaveTranslation save translation into YAML backend, not implemented

Jump to

Keyboard shortcuts

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