locale

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2018 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Localizer *i18n.Localizer
View Source
var T = func(messageID string, template interface{}) string {

	if Localizer == nil {
		SetLanguage("")
	}

	msg := Localizer.MustLocalize(&i18n.LocalizeConfig{
		MessageID:    messageID,
		TemplateData: template})
	return msg
}
View Source
var TP = func(messageID string, template interface{}, pluralCount interface{}) string {

	if Localizer == nil {
		SetLanguage("")
	}

	msg := Localizer.MustLocalize(&i18n.LocalizeConfig{
		MessageID:    messageID,
		TemplateData: template,
		PluralCount:  pluralCount})
	return msg
}

Functions

func SetLanguage

func SetLanguage(lang string)

Types

This section is empty.

Source Files

  • common.go
  • localization.go

Jump to

Keyboard shortcuts

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