From 4a407bdbb092e24a672bd79cbe64f1f1ba355b4b Mon Sep 17 00:00:00 2001 From: Pepe44DEV Date: Sun, 3 May 2026 23:23:47 +0200 Subject: [PATCH] feat: add German and English language switcher --- README.md | 1 + internal/config/config.go | 5 + internal/gui/assets.go | 306 ++++++++++++++++++++++++++++++-------- 3 files changed, 254 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index c059655..81235ba 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ The GUI opens in your browser and lets you: - choose the terminal used for installing updates - manage settings in a dedicated dialog with tabs for general behavior, notifications, installation, and ignored packages - disable reminders, keep install terminals open or let them close, and control confirmation for selective installs +- switch the interface language between German and English Selective package installs use `pacman -S --needed` or the configured AUR helper with `-S --needed`. On Arch, full system updates are still the safer default because partial upgrades can cause dependency mismatches. diff --git a/internal/config/config.go b/internal/config/config.go index 089bf44..f09d290 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -11,6 +11,7 @@ type Config struct { CheckAUR bool `json:"check_aur"` ReminderIntervalHours int `json:"reminder_interval_hours"` Terminal string `json:"terminal"` + Language string `json:"language"` AutoRefreshMinutes int `json:"auto_refresh_minutes"` ShowIgnored bool `json:"show_ignored"` NotificationsEnabled bool `json:"notifications_enabled"` @@ -24,6 +25,7 @@ func Default() Config { CheckAUR: true, ReminderIntervalHours: 168, Terminal: "auto", + Language: "de", AutoRefreshMinutes: 30, ShowIgnored: false, NotificationsEnabled: true, @@ -88,6 +90,9 @@ func normalize(cfg Config) Config { if cfg.Terminal == "" { cfg.Terminal = Default().Terminal } + if cfg.Language != "de" && cfg.Language != "en" { + cfg.Language = Default().Language + } if cfg.AutoRefreshMinutes < 0 { cfg.AutoRefreshMinutes = Default().AutoRefreshMinutes } diff --git a/internal/gui/assets.go b/internal/gui/assets.go index 8fd5538..8ed1ce6 100644 --- a/internal/gui/assets.go +++ b/internal/gui/assets.go @@ -16,24 +16,24 @@ const indexHTML = `

Pruefe Updates...

- - - - + + + +
- Aktive Updates + Aktive Updates 0
- Ausgeblendet + Ausgeblendet 0
- Freier Speicher + Freier Speicher -
@@ -47,13 +47,13 @@ const indexHTML = `
-

Updates

+

Updates

Noch nicht geprueft
- + @@ -64,18 +64,18 @@ const indexHTML = ` 0 Updates ausgewaehlt - Selektive Updates koennen unter Arch riskant sein. Vollupdate bleibt empfohlen. + Selektive Updates koennen unter Arch riskant sein. Vollupdate bleibt empfohlen.
-
Keine passenden Updates gefunden.
+
Keine passenden Updates gefunden.
- - - - + + + + @@ -85,7 +85,7 @@ const indexHTML = ` @@ -97,12 +97,12 @@ const indexHTML = `