localization

package
v0.1.0-rc.14 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package localization loads immutable UI language packs. Message keys are the authored Simplified Chinese strings; missing entries fall back to English.

Index

Constants

View Source
const Default = "zh-CN"

Variables

This section is empty.

Functions

func ValidID

func ValidID(id string) bool

Types

type Pack

type Pack struct {
	Messages map[string]string `json:"messages"`
	ID       string            `json:"id"`
	Label    string            `json:"label"`
}

Pack is immutable after loading and safe to share between workbench views.

func Builtins

func Builtins() []Pack

Builtins returns a copy of the catalog; callers must not mutate message maps.

func English

func English() Pack

English is the common fallback for incomplete or unavailable language packs.

func Parse

func Parse(data []byte) (Pack, error)

func (Pack) Text

func (pack Pack) Text(source string) string

Text performs map lookups only; it does not allocate or format user data.

Jump to

Keyboard shortcuts

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