localemeta

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Load func()

Load, when set, is called before every read so an app can lazily build its catalogs the first time they are needed.

View Source
var Prefixes = []string{"locale_"}

Functions

func Get

func Get(lang, key string) string

LocaleMeta reads a locale-describing entry ("locale_tag", "locale_flag", ...) from that language's own catalog, never from English, so a language that does not define one is not mistaken for English. "" when absent.

func GetOr

func GetOr(lang, key, def string) string

GetOr is LocaleMeta with a fallback.

func Record

func Record(code string, raw []byte)

Record keeps the locale-describing entries (locale_*) of one catalog file so they can be read back for that language alone, without the English fallback the message bundle applies.

func Reset

func Reset()

func UsesCommaDecimal

func UsesCommaDecimal(lang string) bool

UsesCommaDecimal reports whether lang writes decimals with a comma, as its catalog declares (locale_comma_decimal).

Types

This section is empty.

Jump to

Keyboard shortcuts

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