language

package
v0.0.0-...-89b6d9c Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalizedString

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

LocalizedString contains a localized string

func (*LocalizedString) Language

func (l *LocalizedString) Language() language.Tag

Language returns the language of the localized string

func (*LocalizedString) String

func (l *LocalizedString) String() string

String returns the localized string

type Localizer

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

Localizer returns translated phrases

func (*Localizer) TextAccount

func (l *Localizer) TextAccount(count int) *LocalizedString

TextAccount returns a translated phrase.

func (*Localizer) TextDashboard

func (l *Localizer) TextDashboard() *LocalizedString

TextDashboard returns a translated phrase.

func (*Localizer) TextEmail

func (l *Localizer) TextEmail() *LocalizedString

TextEmail returns a translated phrase.

func (*Localizer) TextHelloWorld

func (l *Localizer) TextHelloWorld() *LocalizedString

TextHelloWorld returns a translated phrase.

func (*Localizer) TextHomeShort

func (l *Localizer) TextHomeShort() *LocalizedString

TextHomeShort returns a translated phrase.

func (*Localizer) TextLogin

func (l *Localizer) TextLogin() *LocalizedString

TextLogin returns a translated phrase.

func (*Localizer) TextLoginInvalid

func (l *Localizer) TextLoginInvalid() *LocalizedString

TextLoginInvalid returns a translated phrase.

func (*Localizer) TextLoginShort

func (l *Localizer) TextLoginShort() *LocalizedString

TextLoginShort returns a translated phrase.

func (*Localizer) TextPassword

func (l *Localizer) TextPassword() *LocalizedString

TextPassword returns a translated phrase.

func (*Localizer) TextService

func (l *Localizer) TextService(count int) *LocalizedString

TextService returns a translated phrase.

type Module

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

Module represent the language module for translating text

func New

func New() (*Module, error)

New creates a new language module

func (Module) Language

func (m Module) Language() language.Tag

Language returns the default language

func (Module) NewLocalizer

func (m Module) NewLocalizer(langs ...string) (*Localizer, error)

NewLocalizer returns a localizer which will return translated phrases based on the provided languages

Jump to

Keyboard shortcuts

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