localize

package
v0.0.0-...-4675b65 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const FallbackLanguage = "en-US"

Variables

This section is empty.

Functions

func LoadLocalization

func LoadLocalization(localesPath string, templatesPath ...string) error

Types

type Bundle

type Bundle struct {
	Bundle *i18n.Bundle

	LocalesPath   string
	TemplatesPath string
}
var L *Bundle

func (*Bundle) GetLocalizedString

func (v *Bundle) GetLocalizedString(name string, lang string) string

func (*Bundle) GetLocalizedTemplate

func (v *Bundle) GetLocalizedTemplate(name string, lang string) *template.Template

func (*Bundle) GetLocalizedTemplateHTML

func (v *Bundle) GetLocalizedTemplateHTML(name string, lang string) *htmpl.Template

func (*Bundle) GetLocalizedTemplatePath

func (v *Bundle) GetLocalizedTemplatePath(name string, lang string) string

func (*Bundle) GetLocalizer

func (v *Bundle) GetLocalizer(lang string) *i18n.Localizer

func (*Bundle) RenderLocalizedTemplate

func (v *Bundle) RenderLocalizedTemplate(name string, lang string, data any) string

func (*Bundle) RenderLocalizedTemplateHTML

func (v *Bundle) RenderLocalizedTemplateHTML(name string, lang string, data any) string

Jump to

Keyboard shortcuts

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