Documentation
¶
Index ¶
- Variables
- func FormatMultiple(value any) string
- func FormatPercent(value any) string
- func ImprovementMultiple(baseline, candidate float64) (float64, bool)
- func LoadTranslateFile(fp string) error
- func LoadTranslateFileFS(fsys fs.FS, fp string) error
- func Localize(lang string, msg *goi18n.Message, args map[string]any) string
- func LocalizeWithCatalog(catalog *Catalog, lang string, msg *goi18n.Message, args map[string]any) string
- type Catalog
- func (c *Catalog) LoadTranslateFile(fp string) error
- func (c *Catalog) LoadTranslateFileFS(fsys fs.FS, fp string) error
- func (c *Catalog) LoadTranslateFiles(files ...string) error
- func (c *Catalog) LoadTranslateFilesFS(fsys fs.FS, files ...string) error
- func (c *Catalog) Localize(lang string, msg *goi18n.Message, args map[string]any) string
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func FormatMultiple ¶
FormatMultiple rounds a baseline/candidate ratio for display and groups thousands. Persisted arguments keep the unrounded ratio.
func FormatPercent ¶
FormatPercent rounds display text only. Values that would round across 0% or 100% keep enough decimals to avoid claiming a complete elimination or no change. Persisted message arguments retain their precision.
func ImprovementMultiple ¶
ImprovementMultiple is baseline/candidate when that ratio is a finite improvement that still displays as more than 1x. Cost reduction percent cannot exceed 100; this ratio is the separate "how many times" figure.
func LoadTranslateFile ¶
Types ¶
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
func DefaultCatalog ¶
func DefaultCatalog() *Catalog
func NewCatalog ¶
func NewCatalog() *Catalog