Help us shape the future of Go! Take the 2026 Go Developer Survey

i18n

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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

var (
	T             TranslateFunc
	RESOURCE_PATH = filepath.Join("i18n", "resources")
)

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