Documentation
¶
Index ¶
- func NewWithFilesystem(fss ...http.FileSystem) i18n.Backend
- func NewWithWalk(paths ...string) i18n.Backend
- type Backend
- func (backend *Backend) DeleteTranslation(t *i18n.Translation) error
- func (backend *Backend) LoadTranslations() (translations []*i18n.Translation)
- func (backend *Backend) LoadYAMLContent(content []byte) (translations []*i18n.Translation, err error)
- func (backend *Backend) SaveTranslation(t *i18n.Translation) error
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 ¶
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 (*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
Click to show internal directories.
Click to hide internal directories.