From 722bbc6f4369f22c9d0c9eb910ded032f764ed47 Mon Sep 17 00:00:00 2001 From: Andre <200930841+Andre-Bzk@users.noreply.github.com> Date: Sat, 16 May 2026 11:44:06 +0200 Subject: [PATCH] feat: add German and English UI language support A single-language interface makes the app less usable for part of the audience and encourages more hardcoded copy as new screens and states are added. Introducing a shared i18n path with a persisted language preference gives the UI one consistent way to present text and lowers the risk of partial or inconsistent localization over time. The surrounding copy cleanup belongs in the same change because it aligns existing labels, messages, and settings text with that translation structure instead of leaving mixed localization approaches in place. --- .env.example | 5 + CLAUDE.md | 13 +- README.md | 6 +- electron-builder.yml | 4 +- flatpak/build-flatpak.sh | 115 +++++++----- flatpak/tv.twitch4steamdeck.App.desktop | 2 +- flatpak/tv.twitch4steamdeck.App.yml | 31 ++++ flatpak/twitch4steamdeck.sh | 3 + package.json | 2 +- scripts/test-playback-pipeline.mjs | 57 +++--- src/main/auth/authService.ts | 2 +- src/main/index.ts | 4 +- src/main/input/gamepadReader.ts | 4 +- src/main/ipc/channels.ts | 2 +- src/main/playback/playbackService.ts | 4 +- src/main/store/historyRepo.ts | 2 +- src/main/twitch/types.ts | 10 +- src/renderer/src/App.tsx | 4 +- src/renderer/src/components/ChapterPanel.tsx | 20 ++- src/renderer/src/components/ErrorBoundary.tsx | 5 +- src/renderer/src/components/FocusableCard.tsx | 4 +- src/renderer/src/components/LanguageBadge.tsx | 2 +- .../src/components/PlaybackOverlay.tsx | 26 +-- src/renderer/src/components/QualityPanel.tsx | 6 +- src/renderer/src/components/Sidebar.tsx | 28 +-- src/renderer/src/components/VideoPlayer.tsx | 17 +- src/renderer/src/context/SettingsContext.tsx | 22 ++- src/renderer/src/hooks/usePlaybackSession.ts | 6 +- src/renderer/src/i18n/de.ts | 170 ++++++++++++++++++ src/renderer/src/i18n/en.ts | 168 +++++++++++++++++ src/renderer/src/i18n/useT.ts | 47 +++++ src/renderer/src/input/gamepad.ts | 10 +- src/renderer/src/screens/AccountScreen.tsx | 24 +-- src/renderer/src/screens/AppShell.tsx | 28 +-- src/renderer/src/screens/BrowseScreen.tsx | 36 ++-- src/renderer/src/screens/CategoryScreen.tsx | 18 +- src/renderer/src/screens/ChannelScreen.tsx | 37 ++-- src/renderer/src/screens/FollowingScreen.tsx | 18 +- src/renderer/src/screens/LoginScreen.tsx | 34 ++-- src/renderer/src/screens/SettingsScreen.tsx | 157 ++++++++++------ src/renderer/src/screens/StreamListScreen.tsx | 24 +-- src/renderer/src/styles/global.css | 2 +- 42 files changed, 859 insertions(+), 320 deletions(-) create mode 100644 src/renderer/src/i18n/de.ts create mode 100644 src/renderer/src/i18n/en.ts create mode 100644 src/renderer/src/i18n/useT.ts diff --git a/.env.example b/.env.example index 7c1e98d..bf24120 100644 --- a/.env.example +++ b/.env.example @@ -1,10 +1,15 @@ # Eigene Twitch Application registrieren auf https://dev.twitch.tv/console/apps +# Register your own Twitch application at https://dev.twitch.tv/console/apps # - Name: beliebig (z. B. "Twitch4SteamDeck dev") +# - Name: any value (for example "Twitch4SteamDeck dev") # - OAuth Redirect URLs: http://localhost (wird beim Device Code Flow nicht benutzt, # das Feld muss aber gesetzt sein) +# - OAuth Redirect URLs: http://localhost (not used by the Device Code Flow, +# but the field must still be set) # - Category: Application Integration # - Client Type: Public # # Danach die Client-ID hier eintragen und die Datei in `.env` umbenennen. +# Then add the client ID here and rename the file to `.env`. MAIN_VITE_TWITCH_CLIENT_ID= diff --git a/CLAUDE.md b/CLAUDE.md index 84691b2..1c0602d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -37,6 +37,7 @@ Renderer (React) ├── AppShell.tsx — Tab routing, sidebar/main focus, global playback overlay ├── screens/ — FollowingScreen, BrowseScreen, CategoryScreen, │ ChannelScreen (main screen), StreamListScreen, Settings, Account +├── i18n/ — `de.ts`, `en.ts`, `useT.ts` for localized UI copy ├── components/ │ ├── VideoPlayer.tsx — hls.js