i18n

package
v5.0.0-...-b98a0e9 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IdentityFunc

func IdentityFunc(translationID string, args ...interface{}) string

Types

type I18nBundle

type I18nBundle struct {
	*i18n.Bundle
}

func NewI18nBundle

func NewI18nBundle(box statics.FS) *I18nBundle

NewI18nBundle creates a usable I18nBundle

func (*I18nBundle) LoadBoxTranslationFiles

func (b *I18nBundle) LoadBoxTranslationFiles(box statics.FS)

LoadBoxTranslationFiles loads goi18n translation files from boxes

func (*I18nBundle) T

func (b *I18nBundle) T(languages ...string) TranslateFunc

T provides the correct translation func for language or the IdentityFunc if language is not supported. Languages can be a list of weighted languages as provided in the http header Accept-Language

type TranslateFunc

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

Directories

Path Synopsis
Package languages provides tools to find language in context
Package languages provides tools to find language in context

Jump to

Keyboard shortcuts

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