yaml

package
v0.0.0-...-1c3ad68 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: MIT Imports: 9 Imported by: 34

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

func (backend *Backend) FindTranslation(t *i18n.Translation) (translation i18n.Translation)

FindTranslation find translation from backend

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