language

package
v0.6.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLanguage = language.English

DefaultLanguage is the default language of the application

View Source
var Locales embed.FS

Locales contains static files required by the application

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) TextAddOauth20Client

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

TextAddOauth20Client returns a translated phrase

func (*Localizer) TextClient

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

TextClient returns a translated phrase

func (*Localizer) TextClientID added in v0.5.0

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

TextClientID returns a translated phrase

func (*Localizer) TextClientSecret added in v0.5.0

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

TextClientSecret returns a translated phrase

func (*Localizer) TextCreate

func (l *Localizer) TextCreate() *LocalizedString

TextCreate returns a translated phrase

func (*Localizer) TextDashboard

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

TextDashboard returns a translated phrase

func (*Localizer) TextDescription

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

TextDescription returns a translated phrase

func (*Localizer) TextHome

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

TextHome returns a translated phrase.

func (*Localizer) TextInvalidURI added in v0.6.1

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

TextInvalidURI returns a translated phrase

func (*Localizer) TextLogin

func (l *Localizer) TextLogin() *LocalizedString

TextLogin returns a translated phrase

func (*Localizer) TextLooksGood added in v0.6.0

func (l *Localizer) TextLooksGood() *LocalizedString

TextLooksGood returns a translated phrase

func (*Localizer) TextOauth

func (l *Localizer) TextOauth() *LocalizedString

TextOauth returns a translated phrase

func (*Localizer) TextOauth20Client

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

TextOauth20Client returns a translated phrase

func (*Localizer) TextOauth20Settings

func (l *Localizer) TextOauth20Settings() *LocalizedString

TextOauth20Settings returns a translated phrase

func (*Localizer) TextRedirectURI added in v0.6.2

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

TextRedirectURI returns a translated phrase

func (*Localizer) TextRequired added in v0.6.1

func (l *Localizer) TextRequired() *LocalizedString

TextRequired returns a translated phrase

func (*Localizer) TextUnauthorized

func (l *Localizer) TextUnauthorized() *LocalizedString

TextUnauthorized 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