i18n

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package i18n provides experimental internationalization features.

Backward incompatible API changes are to be expected.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entries

type Entries map[string]string

type Translations

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

func NewTranslations

func NewTranslations() *Translations

func TranslationsFromMap

func TranslationsFromMap(defaultLanguage string, languages map[string]Entries) *Translations

func (*Translations) AddLanguage

func (b *Translations) AddLanguage(code string, entries Entries)

func (*Translations) SetDefaultLanguage

func (b *Translations) SetDefaultLanguage(code string)

func (*Translations) Translate

func (b *Translations) Translate(code, key string, args ...any) string

Jump to

Keyboard shortcuts

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