Files
aego/editor/shell/language_test.go
sanspie 2fcbaa6c12 Stage 11g1: the editor in Russian (D348)
engine/i18n with catalogs, plural forms and module catalogs; tools/i18n extract and check; the editor UI, menus, panels and notices in Russian with the author's terms; overflow test and tooltip wrapping; the English log.
2026-10-25 15:31:22 +03:00

28 lines
714 B
Go

package shell
import (
"testing"
"aego/engine/i18n"
)
// The menu reads Tr every frame, so a language switch shows at once (D348).
func TestMenuTitleFollowsLanguage(t *testing.T) {
b := i18n.Default()
t.Cleanup(func() { b.SetLanguage(i18n.English) })
if got := menuTitle("File"); got != "File" {
t.Fatalf("en: %q", got)
}
b.SetLanguage(i18n.Russian)
if got := menuTitle("File"); got != "Файл" {
t.Fatalf("ru: %q", got)
}
if got := subLabel(themeCategory, menuTitle(themeCategory)+": "+themeName(0)); got == "" || got[0] == 'T' {
t.Fatalf("theme submenu label: %q", got)
}
b.SetLanguage(i18n.English)
if got := menuTitle("Window"); got != "Window" {
t.Fatalf("back to en: %q", got)
}
}