tr

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

README

translate

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Initialize = sync.OnceValue(func() error {
		fd, err := langFS.Open(path.Join("languages", Language()+".toml"))
		if err != nil {
			return err
		}
		defer fd.Close()
		if _, err := toml.NewDecoder(fd).Decode(&langTable); err != nil {
			return err
		}
		return nil
	})
)
View Source
var (
	Language = sync.OnceValue(func() string {
		t, err := locale.Detect()
		if err != nil {
			return "en-US"
		}
		lang := t.String()
		switch {
		case strings.HasPrefix(lang, "zh-Hans"):
			return "zh-CN"
		}
		return lang
	})
)

Functions

func Fprintf

func Fprintf(w io.Writer, format string, a ...any) (n int, err error)

func Sprintf

func Sprintf(format string, a ...any) string

func W

func W(k string) string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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