i18n

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Use

func Use(trans Translator) template.Option

Use registers the `$t` function in the templates. `$t` delegates the calls to `trans.Translate()`.

Types

type Translator

type Translator interface {
	Translate(key, locale string, data map[string]interface{}) (string, error)
}

Translator translates message keys to human readable messages.

type TranslatorFunc

type TranslatorFunc func(string, string, map[string]interface{}) (string, error)

TranslatorFunc allows functions to be used as a `Translator`.

func (TranslatorFunc) Translate

func (fn TranslatorFunc) Translate(key, locale string, data map[string]interface{}) (string, error)

Translate translates message keys to human readable messages.

Directories

Path Synopsis
Package mock_i18n is a generated GoMock package.
Package mock_i18n is a generated GoMock package.

Jump to

Keyboard shortcuts

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