i18n

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 8 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	T                     TranslateFunc
	RESOURCE_PATH         = filepath.Join("i18n", "resources")
	TRANSLATION_NOT_FOUND = "!!i18N_MESSAGE_NOT_FOUND!!"
)

Functions

func Bundle added in v1.0.0

func Bundle() *i18n.Bundle

Bundle returns an instance of i18n.bundle

Types

type TranslateFunc added in v1.0.0

type TranslateFunc func(translateID string, args ...interface{}) string

TranslateFunc returns the translation of the string identified by translationID. @see https://github.com/nicksnyder/go-i18n/blob/v1.3.0/i18n/bundle/bundle.go#L19

func MustTfunc added in v1.0.0

func MustTfunc(sources ...string) TranslateFunc

func Translate added in v1.0.0

func Translate(loc *i18n.Localizer) TranslateFunc

Translate returns a method based on translate method signature in v1.3.0. To allow compatability between v1.3.0 and v2.0+, the `messageId` and `args` parameters are processed to fit with the new Localize API method. @see https://github.com/nicksnyder/go-i18n/blob/v1.3.0/i18n/bundle/bundle.go#L227-L257 for more information on the translate method

Jump to

Keyboard shortcuts

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