localization

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(path string, locales []string)

Initialize : initalizes the translation engine.

func Source

func Source(locale, key string) string

Source : returns the raw source string.

func Translate

func Translate(locale string) bundle.TranslateFunc

Translate : returns the right translate function.

Types

type Engine

type Engine struct {
	TranslateFuncs map[string]bundle.TranslateFunc
	Translations   map[string]map[string]translation.Translation
}

Engine :

var Main *Engine

Main : main localization engine of the application.

func NewEngine

func NewEngine() (e *Engine)

NewEngine : returns a new Engine struct.

func (*Engine) Initialize

func (e *Engine) Initialize(path string, locales []string)

Initialize : initalizes the translation engine.

func (*Engine) Source

func (e *Engine) Source(locale, key string) string

Source : returns the raw source string.

func (*Engine) Translate

func (e *Engine) Translate(locale string) bundle.TranslateFunc

Translate : returns the right translate function.

type H

type H map[string]interface{}

H : shorthand to use map[string]interface{}

type S

type S map[string]string

S : shorthand to use map[string]string

Jump to

Keyboard shortcuts

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