Documentation ¶
Index ¶
- Variables
- func ActiveFitsHeight() bool
- func ActiveFont() string
- func ActiveShape(s string) string
- func ActiveUsesArabicShaping() bool
- func ActiveUsesEbitenText() bool
- func Audit() error
- func CharSet(base string, baseWeight, maxCount int) []rune
- func Errorf(format string, args ...interface{})
- func InitCurrent()
- func ResetLanguage()
- type IType
- type Lingua
- type Type
- type VerticalTextPreference
Constants ¶
This section is empty.
Variables ¶
var Linguas = map[Lingua]struct{}{}
Linguas is the set of current languages that are translated "enough".
Functions ¶
func ActiveFitsHeight ¶ added in v1.5.6
func ActiveFitsHeight() bool
ActiveFitsHeight returns whether height auditing will be performed.
This is only accessible for the active locale so it can later be defined by the language file itself.
func ActiveFont ¶ added in v1.5.6
func ActiveFont() string
ActiveFont returns the font this locale uses.
This is only accessible for the active locale so it can later be defined by the language file itself.
func ActiveShape ¶ added in v1.5.6
ActiveShape performs glyph shaping on a given string.
This is only accessible for the active locale so it can later be defined by the language file itself.
func ActiveUsesArabicShaping ¶ added in v1.5.6
func ActiveUsesArabicShaping() bool
ActiveUsesArabicShaping returns whether Arabic shaping will be performed.
This is only accessible for the active locale so it can later be defined by the language file itself.
func ActiveUsesEbitenText ¶ added in v1.5.6
func ActiveUsesEbitenText() bool
ActiveUsesEbitenText returns whether using ebiten/text for font drawing is safe.
This is only accessible for the active locale so it can later be defined by the language file itself.
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.
const Builtin Lingua = ""
Builtin is a reserved language name for the included language.
const UserProvided Lingua = "."
UserProvided is a reserved language name for language packs.
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) Directory ¶ added in v1.3.186
Directory returns the directory containing the language.
func (Lingua) GroupMembers ¶ added in v1.3.263
GroupMembers returns all additional members of a language group. Groups use the same file, but have {{if eq Lang ...}} template commands for minor differences.
type Type ¶
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.
type VerticalTextPreference ¶ added in v1.5.6
type VerticalTextPreference int
const ( NeverPreferVerticalText VerticalTextPreference = iota DefaultPreferVerticalText AlwaysPreferVerticalText )
func ActivePrefersVerticalText ¶ added in v1.5.6
func ActivePrefersVerticalText() VerticalTextPreference
ActivePrefersVerticalText returns whether this locale prefers vertical text.
This is only accessible for the active locale so it can later be defined by the language file itself.