feat(i18n): katalog id/en — semua string UI via T()/Tf(), fallback en, TIA_LANG sementara + e2e English
CI / test (push) Successful in 24s

This commit is contained in:
oxpoe committed 2026-10-15 09:47:42 +07:00
1 parent 76cdb0b5bb
commit 19ae0d1c29
13 files changed
+540 -76

No files matched your search

+18 -1
View File
@@ -58,12 +58,17 @@ type tui struct {
waited bool
}
func startTUI(t *testing.T) *tui {
func startTUI(t *testing.T) *tui { return startTUIEnv(t) }
func startTUIEnv(t *testing.T, env ...string) *tui {
t.Helper()
if runtime.GOOS == "windows" {
t.Skip("e2e pty tidak didukung di Windows")
}
cmd := exec.Command(binPath)
if len(env) > 0 {
cmd.Env = append(os.Environ(), env...)
}
ptmx, err := pty.StartWithSize(cmd, &pty.Winsize{Rows: rows, Cols: cols})
if err != nil {
t.Fatalf("start pty: %v", err)
@@ -211,6 +216,18 @@ func TestDoctorCommand(t *testing.T) {
}
}
func TestEnglishLanguage(t *testing.T) {
u := startTUIEnv(t, "TIA_LANG=en")
u.waitContains("· home", 5*time.Second)
u.waitContains("Clock", 5*time.Second)
u.send("1")
u.waitContains("· containers", 3*time.Second)
u.send("q")
if code := u.waitExit(5 * time.Second); code != 0 {
t.Fatalf("exit code %d, mau 0", code)
}
}
func TestDashboardNavigation(t *testing.T) {
u := startTUI(t)
u.waitContains("beranda", 5*time.Second)