locale

package
v1.3.511 Latest Latest
Warning

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

Go to latest
Published: May 1, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Linguas = map[Lingua]struct{}{}

Linguas is the set of current languages that are translated "enough".

Functions

func Audit added in v1.3.103

func Audit() error

func CharSet added in v1.3.343

func CharSet(base string, baseWeight, maxCount int) []rune

func Errorf added in v1.3.103

func Errorf(format string, args ...interface{})

func InitCurrent

func InitCurrent()

InitCurrent identifies the system locale. Requires Linguas to have been set.

func ResetLanguage added in v1.3.103

func ResetLanguage()

ResetLanguage makes everything English again.

Types

type IType

type IType = gotext.Translator

IType is the type of a locale translator interface.

var GI IType

GI is the translation of the game but as an interface. Used to work around go vet as it can't figure out that G.Get isn't a printf-like function if it gets only one arg. See https://github.com/golang/go/issues/57288

type Lingua

type Lingua string

Lingua identifies a language.

var Active Lingua

Active is the name of the current language.

var Current Lingua

Current returns the preferred system locale, intersected with available locales.

func LinguasSorted

func LinguasSorted() []Lingua

LinguasSorted returns the languages sorted by humanly expected ordering.

func (Lingua) AuditHeight added in v1.3.263

func (l Lingua) AuditHeight() bool

func (Lingua) Canonical added in v1.3.263

func (l Lingua) Canonical() Lingua

func (Lingua) Directory added in v1.3.186

func (l Lingua) Directory() string

Directory returns the directory containing the language.

func (Lingua) Font added in v1.3.263

func (l Lingua) Font() string

func (Lingua) GroupMembers added in v1.3.263

func (l Lingua) GroupMembers() []Lingua

GroupMembers returns all additional members of a language group. Groups use the same file, but have {{if eq Lang ...}} template commands for minor differences.

func (Lingua) Name

func (l Lingua) Name() string

Name returns the human readable name of a language.

type Type

type Type = *gotext.Po

Type is the type of a locale translator.

var G Type

G is the translation of the game.

var L Type

L is the translation of the levels.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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