Skip to content

Commit 4998033

Browse files
committed
refactor: update dashboard translations and improve account display formatting
1 parent c0af210 commit 4998033

5 files changed

Lines changed: 12 additions & 20 deletions

File tree

i18n/i18n_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestT_BasicAndFormatting(t *testing.T) {
3636

3737
// fmt-style formatting via non-map template args
3838
got := T("dashboard.hosts_current_key", 7)
39-
if got != "Hosts using current key: 7" {
39+
if got != "Current: 7" {
4040
t.Fatalf("unexpected formatted translation: %q", got)
4141
}
4242

i18n/locales/active.art-x-ang.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ dashboard.title: "Cǣġhealdend"
2525
dashboard.subtitle: "Ān unġesandboda SSH cǣġgerefa þe þæt ƿeorc dēþ."
2626
dashboard.system_status: "Systemstede"
2727
dashboard.deployment_status: "Sendungstede"
28-
dashboard.hosts_current_key: "Ƿeardas mid nīƿlīċum cǣġe: %d"
29-
dashboard.hosts_past_keys: "Ƿeardas mid ealdum cǣġ(um): %d"
28+
dashboard.hosts_current_key: "Nīƿlīċe: %d"
29+
dashboard.hosts_past_keys: "Unrihtfæst: %d"
3030
dashboard.system_key.not_generated: "Nā Ġeċeafd"
3131
dashboard.system_key.active: "Dǣdlīċ (Endebyrdnes #%d)"
3232
dashboard.security_posture: "Sċildstede"
3333
dashboard.key_type_spread: "Cǣġa Cræftas: %s"
34-
dashboard.accounts: "Ġerihte Rǣdmenn: %d (%d dǣdlīċe)"
34+
dashboard.accounts: "Ġerihte Rǣdmenn: %d/%d (dǣdlīċe/ealra)"
3535
dashboard.public_keys: "Opene Cǣgan: %d (%d eorþlīċe)"
3636
dashboard.system_key: "Systemcǣġ: %s"
3737
dashboard.recent_activity: "Nīƿe Dǣda"

i18n/locales/active.de.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ dashboard.subtitle: "Ein agentenloser SSH-Schlüsselmanager, der einfach funktio
2626
dashboard.system_status: "Systemstatus"
2727
dashboard.system_key.not_generated: "Nicht erzeugt"
2828
dashboard.deployment_status: "Deployment-Status"
29-
dashboard.hosts_current_key: "Hosts mit aktuellem Schlüssel: %d"
30-
dashboard.hosts_past_keys: "Hosts mit alten Schlüsseln: %d"
29+
dashboard.hosts_current_key: "Aktuell: %d"
30+
dashboard.hosts_past_keys: "Unsynchronisiert: %d"
3131
dashboard.system_key.active: "Aktiv (Seriennr. %d)"
3232
dashboard.security_posture: "Sicherheitsstatus"
33-
dashboard.accounts: "Verwaltete Konten: %d (%d aktiv)"
33+
dashboard.accounts: "Verwaltete Konten: %d/%d (aktiv/gesamt)"
3434
dashboard.key_type_spread: "Schlüssel-Typen: %s"
3535
dashboard.public_keys: "Öffentliche Schlüssel: %d (%d global)"
3636
dashboard.system_key: "Systemschlüssel: %s"

i18n/locales/active.en.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ dashboard.subtitle: "An agentless SSH key manager that just does the job."
2525
dashboard.system_status: "System Status"
2626
dashboard.system_key.not_generated: "Not Generated"
2727
dashboard.deployment_status: "Deployment Status"
28-
dashboard.hosts_current_key: "Hosts using current key: %d"
29-
dashboard.hosts_past_keys: "Hosts using past key(s): %d"
28+
dashboard.hosts_current_key: "Current: %d"
29+
dashboard.hosts_past_keys: "Dirty: %d"
3030
dashboard.system_key.active: "Active (Serial #%d)"
3131
dashboard.security_posture: "Security Posture"
32-
dashboard.accounts: "Managed Accounts: %d (%d active)"
32+
dashboard.accounts: "Managed Accounts: %d/%d (active/total)"
3333
dashboard.key_type_spread: "Key-Type Spread: %s"
3434
dashboard.public_keys: "Public Keys: %d (%d global)"
3535
dashboard.system_key: "System Key: %s"

ui/tui/views/dashboard/model.go

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,13 @@ func (m Model) View() string {
112112
lines := []string{
113113
sectionTitleStyle.Render(i18n.T("dashboard.system_status")),
114114
"",
115-
valueStyle.Render(fmt.Sprintf(i18n.T("dashboard.accounts"), m.data.AccountCount, m.data.ActiveAccountCount)),
115+
valueStyle.Render(fmt.Sprintf(i18n.T("dashboard.accounts"), m.data.ActiveAccountCount, m.data.AccountCount)),
116116
valueStyle.Render(fmt.Sprintf(i18n.T("dashboard.public_keys"), m.data.PublicKeyCount, m.data.GlobalKeyCount)),
117-
valueStyle.Render(fmt.Sprintf(i18n.T("dashboard.system_key"), formatSystemKeySerial(m.data.SystemKeySerial))),
118117
"",
119118
sectionTitleStyle.Render(i18n.T("dashboard.deployment_status")),
120119
"",
121120
valueStyle.Render(fmt.Sprintf(i18n.T("dashboard.hosts_current_key"), m.data.HostsUpToDate)),
122-
valueStyle.Render(fmt.Sprintf(i18n.T("dashboard.hosts_past_keys"), m.data.HostsOutdated)),
121+
warnValueStyle.Render(fmt.Sprintf(i18n.T("dashboard.hosts_past_keys"), m.data.HostsOutdated)),
123122
"",
124123
sectionTitleStyle.Render(i18n.T("dashboard.security_posture")),
125124
"",
@@ -159,13 +158,6 @@ func (m Model) View() string {
159158
return lipgloss.JoinVertical(lipgloss.Left, lines...)
160159
}
161160

162-
func formatSystemKeySerial(serial int) string {
163-
if serial <= 0 {
164-
return i18n.T("dashboard.system_key.not_generated")
165-
}
166-
return fmt.Sprintf(i18n.T("dashboard.system_key_serial"), serial)
167-
}
168-
169161
func formatAlgoSpread(algoCounts map[string]int, style lipgloss.Style) string {
170162
if len(algoCounts) == 0 {
171163
return "-"

0 commit comments

Comments
 (0)