language

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 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) TextAddBlock added in v0.12.0

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

TextAddBlock returns a translated phrase.

func (*Localizer) TextAddOauth20Client

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

TextAddOauth20Client returns a translated phrase.

func (*Localizer) TextAdmin added in v0.12.0

func (l *Localizer) TextAdmin() *LocalizedString

TextAdmin returns a translated phrase.

func (*Localizer) TextAllow added in v0.12.0

func (l *Localizer) TextAllow() *LocalizedString

TextAllow returns a translated phrase.

func (*Localizer) TextApplicationToken added in v0.11.0

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

TextApplicationToken returns a translated phrase.

func (*Localizer) TextAuthorize added in v0.12.0

func (l *Localizer) TextAuthorize() *LocalizedString

TextAuthorize returns a translated phrase.

func (*Localizer) TextAuthorizeApplicationDescription added in v0.12.0

func (l *Localizer) TextAuthorizeApplicationDescription(description string) *LocalizedString

TextAuthorizeApplicationDescription returns a translated phrase.

func (*Localizer) TextBlock added in v0.12.0

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

TextBlock returns a translated phrase.

func (*Localizer) TextBlockExists added in v0.12.0

func (l *Localizer) TextBlockExists(domain string) *LocalizedString

TextBlockExists returns a translated phrase.

func (*Localizer) TextBlockSubdomain added in v0.12.0

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

TextBlockSubdomain returns a translated phrase.

func (*Localizer) TextBlocked added in v0.12.0

func (l *Localizer) TextBlocked() *LocalizedString

TextBlocked returns a translated phrase.

func (*Localizer) TextBlockedDomain added in v0.15.0

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

TextBlockedDomain returns a translated phrase.

func (*Localizer) TextChatID added in v0.15.0

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

TextChatID returns a translated phrase.

func (*Localizer) TextChatIDOrUsername added in v0.15.0

func (l *Localizer) TextChatIDOrUsername() *LocalizedString

TextChatIDOrUsername 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) TextClose added in v0.12.0

func (l *Localizer) TextClose() *LocalizedString

TextClose returns a translated phrase.

func (*Localizer) TextConfig added in v0.14.0

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

TextConfig 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) TextDelete added in v0.12.0

func (l *Localizer) TextDelete() *LocalizedString

TextDelete returns a translated phrase.

func (*Localizer) TextDeleteBlockConfirmDomain added in v0.12.0

func (l *Localizer) TextDeleteBlockConfirmDomain(domain string) *LocalizedString

TextDeleteBlockConfirmDomain returns a translated phrase.

func (*Localizer) TextDeleteBlockDomain added in v0.12.0

func (l *Localizer) TextDeleteBlockDomain(domain string) *LocalizedString

TextDeleteBlockDomain returns a translated phrase.

func (*Localizer) TextDemocrablock added in v0.12.0

func (l *Localizer) TextDemocrablock() *LocalizedString

TextDemocrablock returns a translated phrase.

func (*Localizer) TextDescription

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

TextDescription returns a translated phrase.

func (*Localizer) TextDomain added in v0.12.0

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

TextDomain returns a translated phrase.

func (*Localizer) TextEditBlockDomain added in v0.12.0

func (l *Localizer) TextEditBlockDomain(domain string) *LocalizedString

TextEditBlockDomain returns a translated phrase.

func (*Localizer) TextEnabled added in v0.15.0

func (l *Localizer) TextEnabled() *LocalizedString

TextEnabled returns a translated phrase.

func (*Localizer) TextErrorDatabase added in v0.14.0

func (l *Localizer) TextErrorDatabase() *LocalizedString

TextErrorDatabase returns a translated phrase.

func (*Localizer) TextFediverse added in v0.9.0

func (l *Localizer) TextFediverse() *LocalizedString

TextFediverse returns a translated phrase.

func (*Localizer) TextFollowing added in v0.12.0

func (l *Localizer) TextFollowing() *LocalizedString

TextFollowing returns a translated phrase.

func (*Localizer) TextGeneral added in v0.14.0

func (l *Localizer) TextGeneral() *LocalizedString

TextGeneral returns a translated phrase.

func (*Localizer) TextHomePageBody added in v0.14.0

func (l *Localizer) TextHomePageBody() *LocalizedString

TextHomePageBody returns a translated phrase.

func (*Localizer) TextHomeWeb added in v0.7.0

func (l *Localizer) TextHomeWeb() *LocalizedString

TextHomeWeb returns a translated phrase.

func (*Localizer) TextHowToJoin added in v0.12.0

func (l *Localizer) TextHowToJoin() *LocalizedString

TextHowToJoin returns a translated phrase.

func (*Localizer) TextImport added in v0.12.0

func (l *Localizer) TextImport() *LocalizedString

TextImport returns a translated phrase.

func (*Localizer) TextImportBlockList added in v0.12.0

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

TextImportBlockList returns a translated phrase.

func (*Localizer) TextInstance added in v0.9.0

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

TextInstance 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) TextList added in v0.12.0

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

TextList returns a translated phrase.

func (*Localizer) TextLogin

func (l *Localizer) TextLogin() *LocalizedString

TextLogin returns a translated phrase.

func (*Localizer) TextLogout added in v0.12.0

func (l *Localizer) TextLogout() *LocalizedString

TextLogout returns a translated phrase.

func (*Localizer) TextLooksGood added in v0.6.0

func (l *Localizer) TextLooksGood() *LocalizedString

TextLooksGood returns a translated phrase.

func (*Localizer) TextModeration added in v0.12.0

func (l *Localizer) TextModeration() *LocalizedString

TextModeration returns a translated phrase.

func (*Localizer) TextModerator added in v0.15.1

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

TextModerator returns a translated phrase.

func (*Localizer) TextNotification added in v0.15.0

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

TextNotification 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) TextObfuscatedDomain added in v0.12.0

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

TextObfuscatedDomain 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) TextRelay added in v0.12.0

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

TextRelay returns a translated phrase.

func (*Localizer) TextRequired added in v0.6.1

func (l *Localizer) TextRequired() *LocalizedString

TextRequired returns a translated phrase.

func (*Localizer) TextSave added in v0.14.0

func (l *Localizer) TextSave() *LocalizedString

TextSave returns a translated phrase.

func (*Localizer) TextSetting added in v0.15.0

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

TextSetting returns a translated phrase.

func (*Localizer) TextSystem added in v0.11.0

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

TextSystem returns a translated phrase.

func (*Localizer) TextToken added in v0.11.0

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

TextToken returns a translated phrase.

func (*Localizer) TextUnauthorized

func (l *Localizer) TextUnauthorized() *LocalizedString

TextUnauthorized returns a translated phrase.

func (*Localizer) TextUpdate added in v0.12.0

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

TextUpdate returns a translated phrase.

func (*Localizer) TextUsername added in v0.15.0

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

TextUsername 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