intl

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: BlueOak-1.0.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Report

func Report() map[string]*TranslationReport

Report generates a TranslationReport for each registered language.

Types

type Registrar

type Registrar struct {
	// contains filtered or unexported fields
}

Registrar is used for registering translations for a specific language and caller context.

func NewRegistrar

func NewRegistrar(callerID string, lang string, preAlloc int) *Registrar

NewRegistrar constructs a Registrar.

func (*Registrar) Register

func (r *Registrar) Register(translationID string, t *Translation)

Register registers a translation.

type Translation

type Translation struct {
	Version int
	T       string
	Notes   string // english only
}

Trasnlation is a versioned localized string. Notes added to the english translation will be presented to human translators.

type TranslationReport

type TranslationReport struct {
	Missing map[string]map[string]*Translation // English translation
	Extras  []string                           /* caller ID */
}

TranslationReport is a report of missing and extraneous translations.

Jump to

Keyboard shortcuts

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