Files
felhom-controller/controller/internal/web/i18n_cases_c_test.go
T
admin 0555091f83 i18n slice 1 release C: parity cases + fixtures captured from UNCONVERTED templates
storage, storage_network, storage_init, storage_attach, sharing, login, claim,
launcher_shared, launcher_share_password, catchall, debug. Case completeness checked with the
coverage probe on a trial conversion.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
2026-09-17 18:07:37 +02:00

143 lines
8.2 KiB
Go

package web
// ── i18n slice 1, release C (v0.250.0) — storage, sharing, sign-in and guest pages, debug ───────────
//
// Captured from the UNCONVERTED templates (commit in REPORT.md). Data: multi-word or ASCII values only.
func i18nStoragePaths() []m {
return []m{
{"Path": "/mnt/usb1", "Label": "USB lemez egy", "Disconnected": true, "DisconnectedAt": "2026-09-14 03:12", "StoppedApps": []string{"immich", "kimai"}},
{"Path": "/mnt/old", "Label": "Régi lemez kettő", "Decommissioned": true, "MigratedToLabel": "HDD egy", "MigratedTo": "/mnt/hdd1", "DecommissionedAt": "2026-09-01 10:00"},
{"Path": "/mnt/hdd1", "Label": "HDD egy", "IsDefault": true, "Schedulable": true, "IsUSB": true, "IsMounted": false,
"DiskInfo": m{"UsedHuman": "950 GB", "TotalHuman": "1 TB", "UsedPercent": 95.0}, "FSInfo": m{"FSType": "ext4", "Device": "/dev/sdb1", "Model": "WD Red"},
"StoppedApps": []string{"immich"}, "AppDetails": []m{{"Stack": "immich", "Name": "Immich Photos", "SizeHuman": "12 GB"}},
"AppCount": 1, "HasOtherPaths": true, "IsEnrolled": true},
{"Path": "/mnt/hdd2", "Label": "HDD kettő", "IsDefault": false, "Schedulable": false, "IsUSB": false, "IsMounted": true,
"DiskInfo": m{"UsedHuman": "750 GB", "TotalHuman": "1 TB", "UsedPercent": 75.0}, "FSInfo": m{"FSType": "ext4", "Device": "/dev/sdc1"},
"AppCount": 0, "IsEnrolled": false},
{"Path": "/mnt/hdd3", "Label": "HDD három", "IsDefault": false, "Schedulable": true, "IsMounted": true,
"DiskInfo": m{"UsedHuman": "10 GB", "TotalHuman": "1 TB", "UsedPercent": 1.0}, "AppCount": 0, "IsEnrolled": true},
}
}
func i18nCasesC() []i18nCase {
return []i18nCase{
{"debug", "debug", func() map[string]interface{} {
d := i18nLayoutData("debug", "Debug")
d["DebugMode"] = true
return d
}},
{"storage_full", "storage", func() map[string]interface{} {
d := i18nLayoutData("storage", "Meghajtók kezelése")
d["StorageError"], d["StorageSuccess"] = "Az útvonal nem írható most.", "A tárhely hozzáadva rendben."
d["StoragePaths"] = i18nStoragePaths()
return d
}},
{"storage_empty", "storage", func() map[string]interface{} {
return i18nLayoutData("storage", "Meghajtók kezelése")
}},
{"storage_network_full", "storage_network", func() map[string]interface{} {
d := i18nLayoutData("storage-network", "Hálózati tárhely kezelése")
base := func(name, health string, orphan bool) m {
return m{"Name": name, "Label": "NAS " + name, "Protocol": "nfs", "Server": "nas.example", "Export": "/export/" + name, "Path": "/mnt/net/" + name, "Health": health, "Orphan": orphan}
}
d["NetworkStoragePaths"] = []m{base("a", "ok", true), base("b", "ok", false), base("c", "idle", false), base("d", "stub", false), base("e", "unreachable", false), base("f", "weird", false)}
d["NetAddSupport"] = "yes"
return d
}},
{"storage_network_nosupport", "storage_network", func() map[string]interface{} {
d := i18nLayoutData("storage-network", "Hálózati tárhely kezelése")
d["NetAddSupport"] = "no"
return d
}},
{"storage_init", "storage_init", func() map[string]interface{} {
return i18nLayoutData("storage", "Új meghajtó előkészítése")
}},
{"storage_attach", "storage_attach", func() map[string]interface{} {
return i18nLayoutData("storage", "Meglévő meghajtó csatolása")
}},
{"sharing_full", "sharing", func() map[string]interface{} {
d := i18nLayoutData("sharing", "Hálózati megosztás beállítása")
d["Flash"] = "A megosztás elmentve rendben."
d["SMBEnabled"], d["SMBRunning"], d["SMBUserSet"], d["SMBServerName"], d["SMBDirectAddress"] = true, true, false, "FELHOM", "192.168.1.10"
d["SMBShares"] = []m{
{"Name": "photos", "Path": "/mnt/hdd1/photos", "Available": false, "ReadOnly": true, "Offsite": true, "System": true},
{"Name": "docs", "Path": "/mnt/hdd1/docs", "Available": true, "ReadOnly": false, "Offsite": false, "System": false},
}
d["SharesTier2Status"], d["SharesTier2LastRun"], d["SharesTier2Warning"] = "ok", "2026-09-14 03:12", "egy figyelmeztetés itt"
d["SharesOffsiteStatus"], d["SharesOffsiteCount"], d["SharesOffsiteLastRun"] = "ok", 2, "2026-09-14 03:12"
d["StorageRoots"] = []m{{"Path": "/mnt/hdd1", "Label": "HDD egy"}}
return d
}},
{"sharing_notarget_blocked", "sharing", func() map[string]interface{} {
d := i18nLayoutData("sharing", "Hálózati megosztás beállítása")
d["SMBEnabled"], d["SMBRunning"], d["SMBUserSet"], d["SMBServerName"] = true, false, true, "FELHOM"
d["SMBShares"] = []m{{"Name": "docs", "Path": "/mnt/hdd1/docs", "Available": true}}
d["SharesTier2Status"], d["SharesTier2Error"] = "no_target", "nincs második meghajtó"
d["SharesOffsiteStatus"] = "blocked"
return d
}},
{"sharing_error_skipped", "sharing", func() map[string]interface{} {
d := i18nLayoutData("sharing", "Hálózati megosztás beállítása")
d["SMBEnabled"], d["SMBServerName"] = true, "FELHOM"
d["SMBShares"] = []m{{"Name": "docs", "Path": "/mnt/hdd1/docs", "Available": true}}
d["SharesTier2Status"], d["SharesTier2Error"] = "error", "rsync hiba történt"
d["SharesOffsiteStatus"] = "skipped"
return d
}},
{"sharing_other_none", "sharing", func() map[string]interface{} {
d := i18nLayoutData("sharing", "Hálózati megosztás beállítása")
d["SMBEnabled"], d["SMBServerName"] = true, "FELHOM"
d["SMBShares"] = []m{{"Name": "docs", "Path": "/mnt/hdd1/docs", "Available": true}}
d["SharesOffsiteStatus"] = "failed"
return d
}},
{"sharing_no_offsite_yet", "sharing", func() map[string]interface{} {
d := i18nLayoutData("sharing", "Hálózati megosztás beállítása")
d["SMBEnabled"], d["SMBServerName"] = true, "FELHOM"
d["SMBShares"] = []m{{"Name": "docs", "Path": "/mnt/hdd1/docs", "Available": true}}
d["SharesTier2Status"] = "ok"
return d
}},
{"sharing_off", "sharing", func() map[string]interface{} {
d := i18nLayoutData("sharing", "Hálózati megosztás beállítása")
d["SMBEnabled"], d["SMBServerName"] = false, "FELHOM"
return d
}},
{"login", "login", func() map[string]interface{} {
return m{"Version": "0.250.0", "CustomerName": "Teszt Ügyfél", "Flash": "Sikeres kijelentkezés most.", "Error": "Hibás jelszó lett megadva."}
}},
{"claim_setup_code", "claim", func() map[string]interface{} {
return m{"CustomerName": "Teszt Ügyfél", "Flash": "Az új kód elküldve most.", "Error": "A kód nem érvényes már.", "HasCode": true, "IsReset": false, "ClaimCSRF": "tok", "MinPassword": 12}
}},
{"claim_reset_code", "claim", func() map[string]interface{} {
return m{"CustomerName": "Teszt Ügyfél", "HasCode": true, "IsReset": true, "ClaimCSRF": "tok", "MinPassword": 12}
}},
{"claim_setup_nocode", "claim", func() map[string]interface{} {
return m{"CustomerName": "Teszt Ügyfél", "HasCode": false, "IsReset": false, "ClaimCSRF": "tok", "MinPassword": 12}
}},
{"claim_reset_nocode", "claim", func() map[string]interface{} {
return m{"CustomerName": "Teszt Ügyfél", "HasCode": false, "IsReset": true, "ClaimCSRF": "tok", "MinPassword": 12}
}},
{"launcher_shared_apps", "launcher_shared", func() map[string]interface{} {
return m{"Domain": "example.hu", "Apps": []m{
{"Clickable": true, "Href": "https://paste.example.hu", "Slug": "privatebin", "BrandColor": "", "DisplayName": "Private Bin"},
{"Clickable": false, "Slug": "kimai", "BrandColor": "", "DisplayName": "Kimai Time", "Label": "Jelenleg nem elérhető"},
}}
}},
{"launcher_shared_empty", "launcher_shared", func() map[string]interface{} {
return m{"Domain": "example.hu"}
}},
{"launcher_share_password", "launcher_share_password", func() map[string]interface{} {
return m{"Error": "Hibás jelszó lett megadva.", "Action": "/s/abc", "CSRF": "tok"}
}},
{"catchall_app", "catchall", func() map[string]interface{} {
return m{"AppName": "Private Bin", "AppSlug": "privatebin", "ControllerURL": "https://felhom.example.hu", "Status": "stopped",
"StatusText": "Az alkalmazás jelenleg le van állítva", "Host": "paste.example.hu"}
}},
{"catchall_unknown", "catchall", func() map[string]interface{} {
return m{"ControllerURL": "https://felhom.example.hu", "Status": "unknown", "StatusText": "Ez a cím nem tartozik alkalmazáshoz", "Host": "x.example.hu"}
}},
}
}