lib

package
v0.0.0-...-384037a Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLanguageNotSupportedErrorMessage

func GetLanguageNotSupportedErrorMessage(tag language.Tag) string

GetLanguageNotSupportedErrorMessage

func GetLocaliser

func GetLocaliser() *i18n.Localizer

GetLocaliser gets the current go-i18n localizer instance

func UseTag

func UseTag(tag language.Tag) error

UseTag allows the client to change the language currently in use to a language othr than the one automatically detected.

Types

type LanguageInfo

type LanguageInfo struct {
	// Default language reflects the base language. If all else fails, messages will
	// be in this language. It is fixed at BritishEnglish reflecting the language this
	// package is written in.
	//
	Default language.Tag

	// Detected is the language that is automatically detected of the host machine. Assuming
	// the ost machine is configured of the user's preference, there should be no other
	// reason to divert from this language.
	//
	Detected language.Tag

	// Territory reflects the region as automatically detected.
	//
	Territory string

	// Current reflects the language currently in force. Will by default be the detected
	// language. Client can change this with the UseTag function.
	//
	Current language.Tag

	// Supported indicates the list of languages for which translations are available.
	//
	Supported []language.Tag
}

LanguageInfo indicates information relating to current language. See members for details.

func GetLanguageInfo

func GetLanguageInfo() *LanguageInfo

GetLanguageInfo gets LanguageInfo

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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