Files
aego/editor/ext/inspect/meta.go
sanspie f22242e5aa
ci / release (push) Successful in 5m5s
ci-platforms / build (amd64, windows, windows-2022) (push) Skipped
ci-platforms / build (arm64, darwin, macos-15) (push) Skipped
ci-platforms / build (amd64, darwin, macos-15-intel) (push) Skipped
ci / checks (push) Successful in 4m41s
ci / build (amd64, linux, ubuntu-24.04) (push) Successful in 7m14s
Stage 11g2–11g3: registry texts, CLI and the site in Russian (D348)
The remaining editor strings and undo step names; component, field, enum, setting, diagnostic and Script API texts under schema.*, enum.*, setting.*, diag.* and api.*; the launcher, the in-game Settings View with a Language setting, the CLI and aego schema show --lang. Every documentation page has a .ru.md translation; the site has a full Russian tree with hreflang, a language switch and ru/llms.txt; aego docs check --lang ru. New doc.tutorial and doc.recipe icons. Fix: an animator restored by a rewind prepares its controller before the replayed step.
2026-10-25 15:31:22 +03:00

48 lines
827 B
Go

package inspect
import (
"strings"
"aego/schema"
)
type Meta struct {
DisplayName string
Category string
Icon string
Badge string
}
func Module(full string) string {
if i := strings.IndexByte(full, '.'); i > 0 {
return full[:i]
}
return ""
}
func (r *Registry) Meta(td *schema.TypeDescriptor) Meta {
if m, ok := r.resolved[td.ID]; ok {
m.DisplayName = schema.Title(td)
return m
}
m := Meta{DisplayName: schema.Title(td), Category: td.Category, Icon: td.Icon}
if m.Category == "" {
m.Category = Module(td.FullName)
}
if m.Icon == "" {
m.Icon = "cat." + strings.ToLower(m.Category)
}
if !td.Builtin {
m.Badge = td.Owner
if m.Badge == "" {
m.Badge = Module(td.FullName)
}
}
r.resolved[td.ID] = m
return m
}
func Humanize(s string) string {
return schema.Humanize(s)
}