language

package
v0.0.0-...-8e17a21 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: GPL-2.0 Imports: 9 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// LangList is the list of available languages. It stores two-bytes codes
	LangList []string
)

Functions

func DefLang

func DefLang() string

DefLang returns the default language

func GetLang

func GetLang(state int, accept string) (lng string)

GetLang returns the first language from accept-language

func IsLang

func IsLang(code string) bool

IsLang checks if there is a language with code name

func LangMacro

func LangMacro(input string, state int, accept string) string

LangMacro replaces all inclusions of $resname$ in the incoming text with the corresponding language resources, if they exist

func LangText

func LangText(in string, state int, accept string) (string, bool)

LangText looks for the specified word through language sources and returns the meaning of the source if it is found. Search goes according to the languages specified in 'accept'

func UpdateLang

func UpdateLang(state int, name, value string)

UpdateLang updates language sources for the specified state

Types

This section is empty.

Jump to

Keyboard shortcuts

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