localization

package
v0.0.0-...-a30b172 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2022 License: MIT Imports: 21 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapURL

func MapURL(from, to string)

MapURL allows predefining a specific short URL for a long URL can be used to define vanity URLs for example

func Translate

func Translate(localizations []interfaces.Localization, key string, values ...interface{}) string

Translate translates a given key for the event

Types

type FileSource

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

FileSource is a localization source from a toml file

func NewFileSource

func NewFileSource(path, language string) (*FileSource, error)

NewFileSource creates a new FileSource

func (*FileSource) Language

func (l *FileSource) Language() string

Language returns the language of the localizations

func (*FileSource) Translate

func (l *FileSource) Translate(key string) string

Translate translates a given key

func (*FileSource) TranslateMap

func (l *FileSource) TranslateMap(key string, values map[interface{}]interface{}) string

TranslateMap translates a given key with the given values

func (*FileSource) Translatef

func (l *FileSource) Translatef(key string, fields ...interface{}) string

Translate translates a given key with the given fields

Jump to

Keyboard shortcuts

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